C# 클래스 MusicCatalogue.Services.Areas.HelpPage.ObjectGenerator

This class will create an object of a given type and populate it with sample data.
파일 보기 프로젝트 열기: vladislav-karamfilov/TelerikAcademy 1 사용 예제들

공개 메소드들

메소드 설명
GenerateObject ( Type type ) : object

Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types: Simple types: int, string, Enum, DateTime, Uri, etc. Complex types: POCO types. Nullables: Nullable{T}. Arrays: arrays of simple types or complex types. Key value pairs: KeyValuePair{TKey,TValue} Tuples: Tuple{T1}, Tuple{T1,T2}, etc Dictionaries: IDictionary{TKey,TValue} or anything deriving from IDictionary{TKey,TValue}. Collections: IList{T}, IEnumerable{T}, ICollection{T}, IList, IEnumerable, ICollection or anything deriving from ICollection{T} or IList. Queryables: IQueryable, IQueryable{T}.

비공개 메소드들

메소드 설명
GenerateArray ( Type arrayType, int size, object>.Dictionary createdObjectReferences ) : object
GenerateCollection ( Type collectionType, int size, object>.Dictionary createdObjectReferences ) : object
GenerateComplexObject ( Type type, object>.Dictionary createdObjectReferences ) : object
GenerateDictionary ( Type dictionaryType, int size, object>.Dictionary createdObjectReferences ) : object
GenerateEnum ( Type enumType ) : object
GenerateGenericType ( Type type, int collectionSize, object>.Dictionary createdObjectReferences ) : object
GenerateKeyValuePair ( Type keyValuePairType, object>.Dictionary createdObjectReferences ) : object
GenerateNullable ( Type nullableType, object>.Dictionary createdObjectReferences ) : object
GenerateObject ( Type type, object>.Dictionary createdObjectReferences ) : object
GenerateQueryable ( Type queryableType, int size, object>.Dictionary createdObjectReferences ) : object
GenerateTuple ( Type type, object>.Dictionary createdObjectReferences ) : object
IsTuple ( Type genericTypeDefinition ) : bool
SetPublicFields ( Type type, object obj, object>.Dictionary createdObjectReferences ) : void
SetPublicProperties ( Type type, object obj, object>.Dictionary createdObjectReferences ) : void

메소드 상세

GenerateObject() 공개 메소드

Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types: Simple types: int, string, Enum, DateTime, Uri, etc. Complex types: POCO types. Nullables: Nullable{T}. Arrays: arrays of simple types or complex types. Key value pairs: KeyValuePair{TKey,TValue} Tuples: Tuple{T1}, Tuple{T1,T2}, etc Dictionaries: IDictionary{TKey,TValue} or anything deriving from IDictionary{TKey,TValue}. Collections: IList{T}, IEnumerable{T}, ICollection{T}, IList, IEnumerable, ICollection or anything deriving from ICollection{T} or IList. Queryables: IQueryable, IQueryable{T}.
public GenerateObject ( Type type ) : object
type System.Type The type.
리턴 object