Registering the custom entities and its propertis using XML is another alternative to Fluent API. The primary advantage of configuring it using XML is its in-dependency whenever you want to introduce new modules in the application you need not stop the application and deploy the new changes and start the application.

 

Sample Entity Configuration

  

<EntityConfiguration>
<Entities>
<Entity Identifier="Project" EntityName="Project" PrimaryKeyName="Id" IsExtensible="true" TenantIdColumnName="TenantId" SchemaTableName="dbo.Project" SchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableName="dbo.ProjectExtn">
<Privileges>
<Privilege>View_Project</Privilege>
<Privilege>Add_Project</Privilege>
<Privilege>Delete_Project</Privilege>
<Privilege>Edit_Project</Privilege>
</Privileges>
<Fields>
<Field Identifier="Id" IsUnique="true" Name="Id" TypeID="Guid"/>
<Field Identifier="TenantId" IsUnique="false" Name="TenantId" TypeID="string"/>
<Field Identifier="ProjectName" IsUnique="true" Name="Project Name" TypeID="string"/>
<Field Identifier="ProjectDescription" IsUnique="false" Name="Project Description" TypeID="string"/>
<Field Identifier="StartDate" IsUnique="false" Name="Start Date" TypeID="DateTime"/>
<Field Identifier="EndDate" IsUnique="false" Name="End Date" TypeID="DateTime?"/>
<Field Identifier="Status" IsUnique="false" Name="Status" TypeID="bool"/>
<Field Identifier="CreatedBy" IsUnique="false" Name="Created By" TypeID="string"/>
<Field Identifier="CreatedOn" IsUnique="false" Name="Created On" TypeID="DateTime"/>
<Field Identifier="UpdatedBy" IsUnique="false" Name="Updated By" TypeID="string"/>
<Field Identifier="UpdatedOn" IsUnique="false" Name="Updated On" TypeID="DateTime?"/>
<Field Identifier="ProjectOwner" IsUnique="false" Name="Project Owner" TypeID="string"/>
<Field Identifier="Type" IsUnique="false" Name="Project Type" TypeID="string" PickupListId="06583C29-9B73-E311-A964-000C29C8E241"/>
</Fields>
</Entity>
<Entity Identifier="ProjectTask" EntityName="ProjectTask" PrimaryKeyName="Id" IsExtensible="true" TenantIdColumnName="TenantId" SchemaTableName="dbo.ProjectTask" SchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableName="dbo.ProjectTaskExtn">
<Privileges>
<Privilege>View_ProjectTask</Privilege>
<Privilege>Add_ProjectTask</Privilege>
<Privilege>Delete_ProjectTask</Privilege>
<Privilege>Edit_ProjectTask</Privilege>
</Privileges>
<Fields>
<Field Identifier="Id" IsUnique="true" Name="Id" TypeID="Guid"/>
<Field Identifier="TenantId" IsUnique="false" Name="TenantId" TypeID="string"/>
<Field Identifier="ProjectId" IsUnique="false" Name="Project Id" ReferenceColumnName="Id" ReferenceEntityId="Project" ReferenceTableName="Project" MappedColumnName="ProjectId" TypeID="Guid"/>
<Field Identifier="TaskName" IsUnique="true" Name="Task Name" TypeID="string"/>
<Field Identifier="TaskDescription" IsUnique="false" Name="Task Description" TypeID="string"/>
<Field Identifier="StartDate" IsUnique="false" Name="Start Date" TypeID="DateTime?"/>
<Field Identifier="EndDate" IsUnique="false" Name="End Date" TypeID="DateTime?"/>
<Field Identifier="Status" IsUnique="false" Name="Status" TypeID="bool"/>
<Field Identifier="CreatedBy" IsUnique="false" Name="Created By" TypeID="string"/>
<Field Identifier="CreatedOn" IsUnique="false" Name="Created On" TypeID="DateTime"/>
<Field Identifier="UpdatedBy" IsUnique="false" Name="Updated By" TypeID="string"/>
<Field Identifier="UpdatedOn" IsUnique="false" Name="Updated On" TypeID="DateTime?"/>
</Fields>
</Entity>
<Entity Identifier="EmployeeTask" EntityName="EmployeeTask" IsExtensible="true" PrimaryKeyName="Id" TenantIdColumnName="TenantId" SchemaTableName="dbo.EmployeeTask" SchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableConnectionStringName="ProjectModuleConnectionString" ExtnSchemaTableName="dbo.EmployeeTaskExtn">
<Privileges>
<Privilege>View_EmployeeTask</Privilege>
<Privilege>Add_EmployeeTask</Privilege>
<Privilege>Delete_EmployeeTask</Privilege>
<Privilege>Edit_EmployeeTask</Privilege>
</Privileges>
<Fields>
<Field Identifier="Id" IsUnique="true" Name="Id" TypeID="Guid"/>
<Field Identifier="TenantId" IsUnique="false" Name="TenantId" TypeID="string"/>
<Field Identifier="ProjectTaskId" IsUnique="false" Name="ProjectTask Id" TypeID="Guid"/>
<Field Identifier="EmployeeId" IsUnique="false" Name="Employee Id" TypeID="string"/>
<Field Identifier="TaskStatus" IsUnique="false" Name="Task Status" TypeID="string"/>
<Field Identifier="Status" IsUnique="false" Name="Status" TypeID="bool"/>
<Field Identifier="CreatedBy" IsUnique="false" Name="Created By" TypeID="string"/>
<Field Identifier="CreatedOn" IsUnique="false" Name="Created On" TypeID="DateTime"/>
<Field Identifier="UpdatedBy" IsUnique="false" Name="Updated By" TypeID="string"/>
<Field Identifier="UpdatedOn" IsUnique="false" Name="Updated On" TypeID="DateTime?"/>
</Fields>
</Entity>
</Entities>
</EntityConfiguration>