The documentation comes from the Markdown files in the source code, so is always up-to-date but available only in English. Enjoy!
EntityCodeGenerator automates the creation of entity classes by reading the database schema using SchemaSynchronizer.DefaultGetDatabaseDescription. It generates one entity per table, including operations and field attributes such as SqlDbTypeAttribute, ColumnAttribute, TableAttribute, PrimaryKeyAttribute. This ensures that, once entities are registered in the Schema, synchronizing the database will result in minimal changes.
GetFileName returns the same value for different tables.MList<T> fields and EmbeddedEntity classes for certain tables. Heuristics are used, but you can override GetMListInfo to customize which tables are treated as MList<T>.GetTables to adjust the source database information, such as removing redundant columns or adding foreign keys, to improve the generated classes.All key methods are protected and virtual, allowing you to override them for custom behavior.
The following call tree outlines the main workflow and extension points:
GenerateEntitiesFromDatabaseTables
GetTables
SchemaSynchronizer.DefaultGetDatabaseDescription
GetSolutionInfoGetFileName:
WriteFile
GetUsingNamespacesWriteTableEntity
GetMListInfo is not null:
null
WriteEmbeddedEntity
IsEnum, calls WriteEnum
WriteEntity
GetEntityNameGetEntityAttributes
GetEntityKind, GetEntityData
GetTableNameAttributeGetPrimaryKeyAttribute
GetPrimaryKeyColumnGetValueTypeGetSqlDbTypePartsGetTicksColumnAttributeGetBaseClassWriteBeforeFieldsWriteField
GetRelatedEntityGetFieldTypeGetFieldNameGetFieldAttributes
HasNotNullableAttributeGetSqlTypeAttribute
GetSqlDbTypePartsDefaultColumnNameHasUniqueIndexGetPropertyAttributes
HasNotNullValidatorIsReadonlyGetMListInfo is null, skipWriteFieldMList
GetEntityNameGetRelatedEntityGetFieldTypeGetFieldAttributesGetPrimaryKeyAttributeGetTableNameAttributeGetBackColumnNameAttributeGetFieldMListNameWriteAfterFieldsWriteToString
GetToStringColumnWriteOperations
GetEntityKind is not Main, Shared, or String, skipGetOperationNameOverride the relevant methods to customize entity generation for your database schema and project conventions.
© Signum Software. All Rights Reserved.
Powered by Signum Framework