Skip to main content

linqtypeextensions-class

Contains different extension functions for working with refrection and types

public static class Korzh.EasyQuery.LinqTypeExtensions

Assembly: Korzh.EasyQuery.Linq.dll

Static Methods

NameTypeDescription
CreateType(this TypeBuilder builder)TypeCreates the type.
GetConstructor(this Type type, Type[] types)ConstructorInfoSearches for a public instance constructor whose parameters match the types in the specified array.
GetDisplayName(this PropertyInfo pi)stringReturns the display name of the property. This function tries to get the name defined by Display or DisplayName attributes. If any of these attributes is not defined - then the property name is returned.
GetFields(this Type type)FieldInfo[]Gets the list of fields for the specified type.
GetGenericArguments(this Type type)Type[]Gets the generic arguments (the list of types) for the specified type.
GetInterfaces(this Type type)IEnumerable<Type>Gets the list of interfaces for the specified type.
GetMethod(this Type type, string methodName)MethodInfoSearches for the public method with the specified name.
GetMethod(this Type type, string methodName, Type[] types)MethodInfoSearches for the public method with the specified name.
GetProperties(this Type type)PropertyInfo[]Gets the list of properties for the specified type.
GetProperties(this Type type, BindingFlags bindingFlags)PropertyInfo[]Gets the list of properties for the specified type.
GetProperty(this Type type, string name)PropertyInfoGets the property info for the specified type and property name.
GetTypeDisplayName(this Type type)stringGets the display name of the type. This function tries to get the name defined by Entity or EntityName attributes. If any of these attributes is not defined - then the type name is returned.
IsEnumerable(this Type typeToCheck)boolDetermines whether the specified type is enumerable (supports System.Collections.Generic.IEnumerable interface.
IsEnumerableOfSimpleType(this Type typeToCheck)boolDetermines whether the specified type is an enumerable of some simple type .
IsGenericEnumerable(this Type type)boolDetermines whether the specified type is a generic enumerable.
IsQueryable(this Type typeToCheck)boolDetermines whether the specified type implements System.Linq.IQueryable interface.