C# 클래스 Nettiers.AdventureWorks.Entities.EntityUtil

Provides common utility methods for interacting with objects.
파일 보기 프로젝트 열기: netTiers/netTiers 1 사용 예제들

공개 메소드들

메소드 설명
Add ( IList list, Object item ) : void

Adds the specified object to the collection of objects.

ChangeGenericType ( Object value, Type conversionType ) : Object

Converts the specified value to the specified generic type.

ChangeGenericType ( Object value, Type conversionType, bool convertBlankToNull ) : Object

Converts the specified value to the specified generic type.

ChangeType ( Object value, Type conversionType ) : Object

Converts the specified value to the specified type.

ChangeType ( Object value, Type conversionType, bool convertBlankToNull ) : Object

Converts the specified value to the specified type.

GetConstructor ( Type type ) : ConstructorInfo

Gets the default constructor for the specified type.

GetConstructor ( Type type, Type types ) : ConstructorInfo

Gets the constructor for the specified type whose parameters match the supplied type array.

GetEntity ( IEnumerable entityList, int index ) : Object

Gets the item within entityList at the position specified by index.

GetEntity ( IList entities, String propertyName, Object propertyValue ) : Object

Gets the item within entityList whose property value matches the specifed value.

GetEntityList ( Object entityList ) : IList

Converts the specified object into a collection of objects.

GetEntityList ( Object entity, String propertyName ) : IList

Gets the value of the property with the specified name and returns it as a collection of objects.

GetMethod ( Object item, String methodName ) : MethodInfo

Gets a MethodInfo object representing the method belonging to the object having the specified name.

GetMethod ( Type type, String methodName ) : MethodInfo

Gets a MethodInfo object representing the method belonging to the runtime type having the specified name.

GetNewEntity ( Type type ) : Object

Creates a new instance of the specified type.

GetNewGenericEntity ( Type genericType ) : Object

Creates a new instance of the specified generic type.

GetNewGenericEntity ( Type typeDefinition, Type typeArguments ) : Object

Creates a new instance of the specified generic type.

GetProperty ( Object item, String propertyName ) : PropertyInfo

Gets a PropertyInfo object representing the property belonging to the object having the specified name.

GetProperty ( Type type, String propertyName ) : PropertyInfo

Gets a PropertyInfo object representing the property belonging to the runtime type having the specified name.

GetPropertyValue ( Object item, String propertyName ) : Object

Gets the value of the property with the specified name.

GetPropertyValue ( Object item, String propertyName, PropertyInfo &property ) : Object

Gets the value of the property with the specified name.

GetStaticPropertyValue ( Type type, String propertyName ) : Object

Gets the value of the static property with the specified name.

GetStaticPropertyValue ( Type type, String propertyName, PropertyInfo &property ) : Object

Gets the value of the static property with the specified name.

GetType ( String typeName ) : Type

Gets the System.Type with the specified name.

GetTypeNames ( ) : string

Outputs a string containing the type names, delimited by ", "

GetTypes ( ) : System.Type[]

Gets an array of System.Type objects which match the specified objects. NOTE: this method will throw an exception if any of the values held within the args array are null.

GuidTryParse ( string s, System.Guid &result ) : bool

Converts the string representation of a Guid to its Guid equivalent. A return value indicates whether the operation succeeded.

HasEntities ( IList entities ) : bool

Gets a value indicating whether the specified list contains any items.

InitEntityDateTimeValues ( Object entity ) : void

Initializes the properties specified in propertyNames with the value of DateTime.Now for the specified entity.

InvokeMethod ( Object entity, String methodName ) : Object

Invokes the specified method on the object using reflection.

InvokeMethod ( Object entity, String methodName, Object args ) : Object

Invokes the specified method on the object using reflection. Passes the supplied arguments as method parameters.

InvokeMethod ( Object entity, String methodName, Object args, Type types ) : Object

Invokes the specified method on the object using reflection. Passes the supplied arguments as method parameters.

IsPropertyValueEqual ( Object item, String propertyName, Object propertyValue ) : bool

Determines if the property with the specified name equals the specified value.

MakeGenericType ( Type typeDefinition, Type typeArguments ) : Type

Creates a reference to a generic type using the specified type definition and the supplied type arguments.

Remove ( IList list, Object item ) : void

Removes the specified object from the collection of objects.

SetEntityKeyValue ( Object entity, String entityKeyName ) : System.Guid

Sets the value of the property with the specified name to the value returned by the Guid.NewGuid() method.

SetEntityValues ( Object entity, IDictionary values ) : void

Sets the properties of the specified entity based on the name/value pairs found in the specified collection.

SetPropertyValue ( Object item, String propertyName, Object propertyValue ) : void

Sets the value of the property with the specified name.

SetPropertyValue ( Object item, String propertyName, Object propertyValue, PropertyInfo &property ) : void

Sets the value of the property with the specified name.

SetPropertyValue ( Object item, String propertyName, Object propertyValue, PropertyInfo &property, bool convertBlankToNull ) : void

Sets the value of the property with the specified name.

SetPropertyValue ( Object item, String propertyName, Object propertyValue, bool convertBlankToNull ) : void

Sets the value of the property with the specified name.

메소드 상세

Add() 공개 정적인 메소드

Adds the specified object to the collection of objects.
public static Add ( IList list, Object item ) : void
list IList A collection of objects.
item Object The obejct to add.
리턴 void

ChangeGenericType() 공개 정적인 메소드

Converts the specified value to the specified generic type.
public static ChangeGenericType ( Object value, Type conversionType ) : Object
value Object The value to convert.
conversionType System.Type A System.Type to convert to.
리턴 Object

ChangeGenericType() 공개 정적인 메소드

Converts the specified value to the specified generic type.
public static ChangeGenericType ( Object value, Type conversionType, bool convertBlankToNull ) : Object
value Object The value to convert.
conversionType System.Type A System.Type to convert to.
convertBlankToNull bool A value indicating whether to treat /// empty string objects as null values.
리턴 Object

ChangeType() 공개 정적인 메소드

Converts the specified value to the specified type.
public static ChangeType ( Object value, Type conversionType ) : Object
value Object The value to convert.
conversionType System.Type A System.Type to convert to.
리턴 Object

ChangeType() 공개 정적인 메소드

Converts the specified value to the specified type.
public static ChangeType ( Object value, Type conversionType, bool convertBlankToNull ) : Object
value Object The value to convert.
conversionType System.Type A System.Type to convert to.
convertBlankToNull bool A value indicating whether to treat /// empty string objects as null values.
리턴 Object

GetConstructor() 공개 정적인 메소드

Gets the default constructor for the specified type.
public static GetConstructor ( Type type ) : ConstructorInfo
type System.Type The runtime type.
리턴 System.Reflection.ConstructorInfo

GetConstructor() 공개 정적인 메소드

Gets the constructor for the specified type whose parameters match the supplied type array.
public static GetConstructor ( Type type, Type types ) : ConstructorInfo
type System.Type The runtime type.
types System.Type An array of constructor parameter types.
리턴 System.Reflection.ConstructorInfo

GetEntity() 공개 정적인 메소드

Gets the item within entityList at the position specified by index.
public static GetEntity ( IEnumerable entityList, int index ) : Object
entityList IEnumerable The collection of business objects.
index int The position within entityList that contains the current item.
리턴 Object

GetEntity() 공개 정적인 메소드

Gets the item within entityList whose property value matches the specifed value.
public static GetEntity ( IList entities, String propertyName, Object propertyValue ) : Object
entities IList A collection of objects.
propertyName String The property name.
propertyValue Object The property value.
리턴 Object

GetEntityList() 공개 정적인 메소드

Converts the specified object into a collection of objects.
public static GetEntityList ( Object entityList ) : IList
entityList Object An object instance.
리턴 IList

GetEntityList() 공개 정적인 메소드

Gets the value of the property with the specified name and returns it as a collection of objects.
public static GetEntityList ( Object entity, String propertyName ) : IList
entity Object An object instance.
propertyName String The property name.
리턴 IList

GetMethod() 공개 정적인 메소드

Gets a MethodInfo object representing the method belonging to the object having the specified name.
public static GetMethod ( Object item, String methodName ) : MethodInfo
item Object An object instance.
methodName String The method name.
리턴 System.Reflection.MethodInfo

GetMethod() 공개 정적인 메소드

Gets a MethodInfo object representing the method belonging to the runtime type having the specified name.
public static GetMethod ( Type type, String methodName ) : MethodInfo
type System.Type The runtime type.
methodName String The method name.
리턴 System.Reflection.MethodInfo

GetNewEntity() 공개 정적인 메소드

Creates a new instance of the specified type.
public static GetNewEntity ( Type type ) : Object
type System.Type The runtime type to instantiate.
리턴 Object

GetNewGenericEntity() 공개 정적인 메소드

Creates a new instance of the specified generic type.
public static GetNewGenericEntity ( Type genericType ) : Object
genericType System.Type The runtime type.
리턴 Object

GetNewGenericEntity() 공개 정적인 메소드

Creates a new instance of the specified generic type.
public static GetNewGenericEntity ( Type typeDefinition, Type typeArguments ) : Object
typeDefinition System.Type A generic type definition.
typeArguments System.Type An array of System.Type arguments.
리턴 Object

GetProperty() 공개 정적인 메소드

Gets a PropertyInfo object representing the property belonging to the object having the specified name.
public static GetProperty ( Object item, String propertyName ) : PropertyInfo
item Object An object instance.
propertyName String The property name.
리턴 System.Reflection.PropertyInfo

GetProperty() 공개 정적인 메소드

Gets a PropertyInfo object representing the property belonging to the runtime type having the specified name.
public static GetProperty ( Type type, String propertyName ) : PropertyInfo
type System.Type The runtime type.
propertyName String The property name.
리턴 System.Reflection.PropertyInfo

GetPropertyValue() 공개 정적인 메소드

Gets the value of the property with the specified name.
public static GetPropertyValue ( Object item, String propertyName ) : Object
item Object An object instance.
propertyName String The property name.
리턴 Object

GetPropertyValue() 공개 정적인 메소드

Gets the value of the property with the specified name.
public static GetPropertyValue ( Object item, String propertyName, PropertyInfo &property ) : Object
item Object An object instance.
propertyName String The property name.
property System.Reflection.PropertyInfo A reference to the object.
리턴 Object

GetStaticPropertyValue() 공개 정적인 메소드

Gets the value of the static property with the specified name.
public static GetStaticPropertyValue ( Type type, String propertyName ) : Object
type System.Type The runtime type.
propertyName String The property name.
리턴 Object

GetStaticPropertyValue() 공개 정적인 메소드

Gets the value of the static property with the specified name.
public static GetStaticPropertyValue ( Type type, String propertyName, PropertyInfo &property ) : Object
type System.Type The runtime type.
propertyName String The property name.
property System.Reflection.PropertyInfo A reference to the object.
리턴 Object

GetType() 공개 정적인 메소드

Gets the System.Type with the specified name.
public static GetType ( String typeName ) : Type
typeName String The name of the type to get.
리턴 System.Type

GetTypeNames() 공개 정적인 메소드

Outputs a string containing the type names, delimited by ", "
public static GetTypeNames ( ) : string
리턴 string

GetTypes() 공개 정적인 메소드

Gets an array of System.Type objects which match the specified objects. NOTE: this method will throw an exception if any of the values held within the args array are null.
public static GetTypes ( ) : System.Type[]
리턴 System.Type[]

GuidTryParse() 공개 정적인 메소드

Converts the string representation of a Guid to its Guid equivalent. A return value indicates whether the operation succeeded.
/// Thrown if is . ///
public static GuidTryParse ( string s, System.Guid &result ) : bool
s string A string containing a Guid to convert.
result System.Guid /// When this method returns, contains the Guid value equivalent to /// the Guid contained in , if the conversion /// succeeded, or if the conversion failed. /// The conversion fails if the parameter is a /// reference ( in /// Visual Basic), or is not of the correct format. ///
리턴 bool

HasEntities() 공개 정적인 메소드

Gets a value indicating whether the specified list contains any items.
public static HasEntities ( IList entities ) : bool
entities IList A collection of objects.
리턴 bool

InitEntityDateTimeValues() 공개 정적인 메소드

Initializes the properties specified in propertyNames with the value of DateTime.Now for the specified entity.
public static InitEntityDateTimeValues ( Object entity ) : void
entity Object The instance of an object to set the properties on.
리턴 void

InvokeMethod() 공개 정적인 메소드

Invokes the specified method on the object using reflection.
public static InvokeMethod ( Object entity, String methodName ) : Object
entity Object An object instance.
methodName String The method name.
리턴 Object

InvokeMethod() 공개 정적인 메소드

Invokes the specified method on the object using reflection. Passes the supplied arguments as method parameters.
public static InvokeMethod ( Object entity, String methodName, Object args ) : Object
entity Object An object instance.
methodName String The method name.
args Object The method parameters.
리턴 Object

InvokeMethod() 공개 정적인 메소드

Invokes the specified method on the object using reflection. Passes the supplied arguments as method parameters.
public static InvokeMethod ( Object entity, String methodName, Object args, Type types ) : Object
entity Object An object instance.
methodName String The method name.
args Object The method parameters.
types System.Type The method parameter types.
리턴 Object

IsPropertyValueEqual() 공개 정적인 메소드

Determines if the property with the specified name equals the specified value.
public static IsPropertyValueEqual ( Object item, String propertyName, Object propertyValue ) : bool
item Object An object instance.
propertyName String The property name.
propertyValue Object The property value.
리턴 bool

MakeGenericType() 공개 정적인 메소드

Creates a reference to a generic type using the specified type definition and the supplied type arguments.
public static MakeGenericType ( Type typeDefinition, Type typeArguments ) : Type
typeDefinition System.Type A generic type definition.
typeArguments System.Type An array of System.Type arguments.
리턴 System.Type

Remove() 공개 정적인 메소드

Removes the specified object from the collection of objects.
public static Remove ( IList list, Object item ) : void
list IList A collection of objects.
item Object The object to remove.
리턴 void

SetEntityKeyValue() 공개 정적인 메소드

Sets the value of the property with the specified name to the value returned by the Guid.NewGuid() method.
public static SetEntityKeyValue ( Object entity, String entityKeyName ) : System.Guid
entity Object An object instance.
entityKeyName String The property name.
리턴 System.Guid

SetEntityValues() 공개 정적인 메소드

Sets the properties of the specified entity based on the name/value pairs found in the specified collection.
public static SetEntityValues ( Object entity, IDictionary values ) : void
entity Object The instance of an object to set the properties on.
values IDictionary An instance of System.Collections.IDictionary containing the name/value pairs.
리턴 void

SetPropertyValue() 공개 정적인 메소드

Sets the value of the property with the specified name.
public static SetPropertyValue ( Object item, String propertyName, Object propertyValue ) : void
item Object An object instance.
propertyName String The property name.
propertyValue Object The property value.
리턴 void

SetPropertyValue() 공개 정적인 메소드

Sets the value of the property with the specified name.
public static SetPropertyValue ( Object item, String propertyName, Object propertyValue, PropertyInfo &property ) : void
item Object An object instance.
propertyName String The property name.
propertyValue Object The property value.
property System.Reflection.PropertyInfo A reference to the object.
리턴 void

SetPropertyValue() 공개 정적인 메소드

Sets the value of the property with the specified name.
public static SetPropertyValue ( Object item, String propertyName, Object propertyValue, PropertyInfo &property, bool convertBlankToNull ) : void
item Object An object instance.
propertyName String The property name.
propertyValue Object The property value.
property System.Reflection.PropertyInfo A reference to the object.
convertBlankToNull bool Boolean indicating whether empty strings should be converted to null values.
리턴 void

SetPropertyValue() 공개 정적인 메소드

Sets the value of the property with the specified name.
public static SetPropertyValue ( Object item, String propertyName, Object propertyValue, bool convertBlankToNull ) : void
item Object An object instance.
propertyName String The property name.
propertyValue Object The property value.
convertBlankToNull bool Boolean indicating whether empty strings should be converted to null values.
리턴 void