LinqUtilsCreateEntityInstanceFromEntityType Method |
Creates a new entity instance from the type specified. This routine uses a factory related to the type, not Activator, as some abstract entities
may be used which don't have a public ctor. Falls back to activator if type is a custom type derived from an entity class.
Namespace:
SD.LLBLGen.Pro.LinqSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.9.0.0 (5.9.0)
Syntax public static IEntityCore CreateEntityInstanceFromEntityType(
Type entityType,
IElementCreatorCore generatedCodeElementCreator,
bool alwaysCreateNew = false
)
Public Shared Function CreateEntityInstanceFromEntityType (
entityType As Type,
generatedCodeElementCreator As IElementCreatorCore,
Optional alwaysCreateNew As Boolean = false
) As IEntityCore
Parameters
- entityType
- Type: SystemType
Type of the entity. - generatedCodeElementCreator
- Type: SD.LLBLGen.Pro.ORMSupportClassesIElementCreatorCore
The generated code element creator. - alwaysCreateNew (Optional)
- Type: SystemBoolean
If true (default is false), it'll simply always create a new instance. If false, it'll return a cached instance
Return Value
Type:
IEntityCoreready to use entity instance
See Also