Class EntityModel
Contains mapping entity attributes.
public sealed class EntityModel
- Inheritance
-
EntityModel
- Extension Methods
Constructors
EntityModel(EntityMetadata, ClassModel, PropertyModel?)
public EntityModel(EntityMetadata metadata, ClassModel @class, PropertyModel? contextProperty)
Parameters
metadata
EntityMetadataclass
ClassModelcontextProperty
PropertyModel
Properties
Class
Gets or sets entity class attributes.
public ClassModel Class { get; set; }
Property Value
Columns
Entity columns collection. Code for columns generated in same order as columns ordered in this list.
public List<ColumnModel> Columns { get; }
Property Value
ContextProperty
Gets or sets data context property definition for current entity. Example:
public class MyDataContext
{
...
public ITable<MyEntity> MyEntities => GetTable<MyEntity>();
...
}
Type of property must be open-generic type (ITable<T> or IQueryable<T>) as we will use it to instantiate final generic type during code model generation.
public PropertyModel? ContextProperty { get; set; }
Property Value
FindExtensions
Gets or sets enum value that defines which Find entity extension methods to generate.
public FindTypes FindExtensions { get; set; }
Property Value
ImplementsIEquatable
Gets or sets flag indicating that entity class should implement IEquatable<T> interface, which compares entity instances using primary key columns. Ignored for entities without primary key.
public bool ImplementsIEquatable { get; set; }
Property Value
Metadata
Gets or sets entity mapping metadata.
public EntityMetadata Metadata { get; set; }