├── .editorconfig
├── .gitattributes
├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ ├── docs.yml
│ ├── dotnet.yml
│ └── merge.yml
├── .gitignore
├── EntityFrameworkCore.Generator.sln
├── LICENSE
├── README.md
├── coverlet.runsettings
├── docs
├── commands.md
├── configuration.md
├── connectionString.md
├── ef
│ ├── dataContext.md
│ ├── entity.md
│ ├── extensions.md
│ └── mapping.md
├── index.md
├── md
│ ├── create.md
│ ├── mapper.md
│ ├── read.md
│ ├── shared.md
│ ├── update.md
│ └── validation.md
├── providers.md
├── quickStart.md
├── readme.md
├── regeneration.md
├── scripts.md
└── variables.md
├── logo.png
├── mkdocs.yml
├── sample
├── Templates
│ ├── context-yaml.csx
│ ├── entity-yaml.csx
│ ├── model-yaml.csx
│ └── typescript.csx
├── Tracker.PostgreSQL
│ ├── Tracker.PostgreSQL.Core
│ │ ├── Data
│ │ │ ├── Entities
│ │ │ │ ├── Audit.cs
│ │ │ │ ├── Priority.cs
│ │ │ │ ├── Role.cs
│ │ │ │ ├── Status.cs
│ │ │ │ ├── Task.cs
│ │ │ │ ├── TaskExtended.cs
│ │ │ │ ├── User.cs
│ │ │ │ ├── UserLogin.cs
│ │ │ │ └── UserRole.cs
│ │ │ ├── Mapping
│ │ │ │ ├── AuditMap.cs
│ │ │ │ ├── PriorityMap.cs
│ │ │ │ ├── RoleMap.cs
│ │ │ │ ├── StatusMap.cs
│ │ │ │ ├── TaskExtendedMap.cs
│ │ │ │ ├── TaskMap.cs
│ │ │ │ ├── UserLoginMap.cs
│ │ │ │ ├── UserMap.cs
│ │ │ │ └── UserRoleMap.cs
│ │ │ ├── Queries
│ │ │ │ ├── AuditExtensions.cs
│ │ │ │ ├── PriorityExtensions.cs
│ │ │ │ ├── RoleExtensions.cs
│ │ │ │ ├── StatusExtensions.cs
│ │ │ │ ├── TaskExtendedExtensions.cs
│ │ │ │ ├── TaskExtensions.cs
│ │ │ │ ├── UserExtensions.cs
│ │ │ │ ├── UserLoginExtensions.cs
│ │ │ │ └── UserRoleExtensions.cs
│ │ │ └── TrackerContext.cs
│ │ ├── Domain
│ │ │ ├── Mapping
│ │ │ │ ├── AuditProfile.cs
│ │ │ │ ├── PriorityProfile.cs
│ │ │ │ ├── RoleProfile.cs
│ │ │ │ ├── StatusProfile.cs
│ │ │ │ ├── TaskExtendedProfile.cs
│ │ │ │ ├── TaskProfile.cs
│ │ │ │ ├── UserLoginProfile.cs
│ │ │ │ ├── UserProfile.cs
│ │ │ │ └── UserRoleProfile.cs
│ │ │ ├── Models
│ │ │ │ ├── AuditCreateModel.cs
│ │ │ │ ├── AuditReadModel.cs
│ │ │ │ ├── AuditUpdateModel.cs
│ │ │ │ ├── PriorityCreateModel.cs
│ │ │ │ ├── PriorityReadModel.cs
│ │ │ │ ├── PriorityUpdateModel.cs
│ │ │ │ ├── RoleCreateModel.cs
│ │ │ │ ├── RoleReadModel.cs
│ │ │ │ ├── RoleUpdateModel.cs
│ │ │ │ ├── StatusCreateModel.cs
│ │ │ │ ├── StatusReadModel.cs
│ │ │ │ ├── StatusUpdateModel.cs
│ │ │ │ ├── TaskCreateModel.cs
│ │ │ │ ├── TaskExtendedCreateModel.cs
│ │ │ │ ├── TaskExtendedReadModel.cs
│ │ │ │ ├── TaskExtendedUpdateModel.cs
│ │ │ │ ├── TaskReadModel.cs
│ │ │ │ ├── TaskUpdateModel.cs
│ │ │ │ ├── UserCreateModel.cs
│ │ │ │ ├── UserLoginCreateModel.cs
│ │ │ │ ├── UserLoginReadModel.cs
│ │ │ │ ├── UserLoginUpdateModel.cs
│ │ │ │ ├── UserReadModel.cs
│ │ │ │ ├── UserRoleCreateModel.cs
│ │ │ │ ├── UserRoleReadModel.cs
│ │ │ │ ├── UserRoleUpdateModel.cs
│ │ │ │ └── UserUpdateModel.cs
│ │ │ └── Validation
│ │ │ │ ├── AuditCreateModelValidator.cs
│ │ │ │ ├── AuditUpdateModelValidator.cs
│ │ │ │ ├── PriorityCreateModelValidator.cs
│ │ │ │ ├── PriorityUpdateModelValidator.cs
│ │ │ │ ├── RoleCreateModelValidator.cs
│ │ │ │ ├── RoleUpdateModelValidator.cs
│ │ │ │ ├── StatusCreateModelValidator.cs
│ │ │ │ ├── StatusUpdateModelValidator.cs
│ │ │ │ ├── TaskCreateModelValidator.cs
│ │ │ │ ├── TaskExtendedCreateModelValidator.cs
│ │ │ │ ├── TaskExtendedUpdateModelValidator.cs
│ │ │ │ ├── TaskUpdateModelValidator.cs
│ │ │ │ ├── UserCreateModelValidator.cs
│ │ │ │ ├── UserLoginCreateModelValidator.cs
│ │ │ │ ├── UserLoginUpdateModelValidator.cs
│ │ │ │ ├── UserRoleCreateModelValidator.cs
│ │ │ │ ├── UserRoleUpdateModelValidator.cs
│ │ │ │ └── UserUpdateModelValidator.cs
│ │ ├── Tracker.PostgreSQL.Core.csproj
│ │ └── generation.yml
│ ├── Tracker.PostgreSQL.Database
│ │ ├── Program.cs
│ │ ├── Scripts
│ │ │ ├── Script001.Tracker.Schema.sql
│ │ │ └── Script002.Tracker.Data.sql
│ │ ├── Tracker.PostgreSQL.Database.csproj
│ │ └── appsettings.json
│ └── Tracker.PostgreSQL.sln
├── Tracker
│ ├── Tracker.Core
│ │ ├── Data
│ │ │ ├── Entities
│ │ │ │ ├── Audit.cs
│ │ │ │ ├── Priority.cs
│ │ │ │ ├── Role.cs
│ │ │ │ ├── Status.cs
│ │ │ │ ├── Task.cs
│ │ │ │ ├── TaskExtended.cs
│ │ │ │ ├── Tenant.cs
│ │ │ │ ├── User.cs
│ │ │ │ ├── UserLogin.cs
│ │ │ │ └── UserRole.cs
│ │ │ ├── Mapping
│ │ │ │ ├── AuditMap.cs
│ │ │ │ ├── PriorityMap.cs
│ │ │ │ ├── RoleMap.cs
│ │ │ │ ├── StatusMap.cs
│ │ │ │ ├── TaskExtendedMap.cs
│ │ │ │ ├── TaskMap.cs
│ │ │ │ ├── TenantMap.cs
│ │ │ │ ├── UserLoginMap.cs
│ │ │ │ ├── UserMap.cs
│ │ │ │ └── UserRoleMap.cs
│ │ │ ├── Queries
│ │ │ │ ├── AuditExtensions.cs
│ │ │ │ ├── PriorityExtensions.cs
│ │ │ │ ├── RoleExtensions.cs
│ │ │ │ ├── StatusExtensions.cs
│ │ │ │ ├── TaskExtendedExtensions.cs
│ │ │ │ ├── TaskExtensions.cs
│ │ │ │ ├── TenantExtensions.cs
│ │ │ │ ├── UserExtensions.cs
│ │ │ │ ├── UserLoginExtensions.cs
│ │ │ │ └── UserRoleExtensions.cs
│ │ │ └── TrackerContext.cs
│ │ ├── Definitions
│ │ │ ├── IHaveIdentifier.cs
│ │ │ ├── ITrackConcurrency.cs
│ │ │ ├── ITrackCreated.cs
│ │ │ ├── ITrackDeleted.cs
│ │ │ └── ITrackUpdated.cs
│ │ ├── Domain
│ │ │ ├── Audit
│ │ │ │ ├── Mapping
│ │ │ │ │ └── AuditProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── AuditCreateModel.cs
│ │ │ │ │ ├── AuditReadModel.cs
│ │ │ │ │ └── AuditUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── AuditCreateModelValidator.cs
│ │ │ │ │ └── AuditUpdateModelValidator.cs
│ │ │ ├── EntityCreateModel.cs
│ │ │ ├── EntityReadModel.cs
│ │ │ ├── EntityUpdateModel.cs
│ │ │ ├── Priority
│ │ │ │ ├── Mapping
│ │ │ │ │ └── PriorityProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── PriorityCreateModel.cs
│ │ │ │ │ ├── PriorityReadModel.cs
│ │ │ │ │ └── PriorityUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── PriorityCreateModelValidator.cs
│ │ │ │ │ └── PriorityUpdateModelValidator.cs
│ │ │ ├── Role
│ │ │ │ ├── Mapping
│ │ │ │ │ └── RoleProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── RoleCreateModel.cs
│ │ │ │ │ ├── RoleReadModel.cs
│ │ │ │ │ └── RoleUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── RoleCreateModelValidator.cs
│ │ │ │ │ └── RoleUpdateModelValidator.cs
│ │ │ ├── Status
│ │ │ │ ├── Mapping
│ │ │ │ │ └── StatusProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── StatusCreateModel.cs
│ │ │ │ │ ├── StatusReadModel.cs
│ │ │ │ │ └── StatusUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── StatusCreateModelValidator.cs
│ │ │ │ │ └── StatusUpdateModelValidator.cs
│ │ │ ├── Task
│ │ │ │ ├── Mapping
│ │ │ │ │ └── TaskProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── TaskCreateModel.cs
│ │ │ │ │ ├── TaskReadModel.cs
│ │ │ │ │ └── TaskUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── TaskCreateModelValidator.cs
│ │ │ │ │ └── TaskUpdateModelValidator.cs
│ │ │ ├── TaskExtended
│ │ │ │ ├── Mapping
│ │ │ │ │ └── TaskExtendedProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── TaskExtendedCreateModel.cs
│ │ │ │ │ ├── TaskExtendedReadModel.cs
│ │ │ │ │ └── TaskExtendedUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── TaskExtendedCreateModelValidator.cs
│ │ │ │ │ └── TaskExtendedUpdateModelValidator.cs
│ │ │ ├── Tenant
│ │ │ │ ├── Mapping
│ │ │ │ │ └── TenantProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── TenantCreateModel.cs
│ │ │ │ │ ├── TenantReadModel.cs
│ │ │ │ │ └── TenantUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── TenantCreateModelValidator.cs
│ │ │ │ │ └── TenantUpdateModelValidator.cs
│ │ │ ├── User
│ │ │ │ ├── Mapping
│ │ │ │ │ └── UserProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── UserCreateModel.cs
│ │ │ │ │ ├── UserReadModel.cs
│ │ │ │ │ └── UserUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── UserCreateModelValidator.cs
│ │ │ │ │ └── UserUpdateModelValidator.cs
│ │ │ ├── UserLogin
│ │ │ │ ├── Mapping
│ │ │ │ │ └── UserLoginProfile.cs
│ │ │ │ └── Models
│ │ │ │ │ └── UserLoginReadModel.cs
│ │ │ └── UserRole
│ │ │ │ ├── Mapping
│ │ │ │ └── UserRoleProfile.cs
│ │ │ │ ├── Models
│ │ │ │ ├── UserRoleCreateModel.cs
│ │ │ │ ├── UserRoleReadModel.cs
│ │ │ │ └── UserRoleUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ ├── UserRoleCreateModelValidator.cs
│ │ │ │ └── UserRoleUpdateModelValidator.cs
│ │ ├── Tracker.Core.csproj
│ │ └── generation.yml
│ ├── Tracker.Database
│ │ ├── Program.cs
│ │ ├── Scripts
│ │ │ ├── Script001.Tracker.Schema.sql
│ │ │ └── Script002.Tracker.Data.sql
│ │ ├── Tracker.Database.csproj
│ │ └── appsettings.json
│ ├── Tracker.Scaffold
│ │ ├── Audit.cs
│ │ ├── Priority.cs
│ │ ├── Role.cs
│ │ ├── SchemaVersion.cs
│ │ ├── Status.cs
│ │ ├── Task.cs
│ │ ├── TaskExtended.cs
│ │ ├── Tenant.cs
│ │ ├── Tracker.Scaffold.csproj
│ │ ├── TrackerContext.cs
│ │ ├── User.cs
│ │ ├── UserLogin.cs
│ │ └── scaffold.cmd
│ ├── Tracker.Web
│ │ ├── Controllers
│ │ │ ├── AuditController.cs
│ │ │ ├── EntityControllerBase.cs
│ │ │ ├── PriorityController.cs
│ │ │ ├── QueryControllerBase.cs
│ │ │ ├── RoleController.cs
│ │ │ ├── StatusController.cs
│ │ │ ├── TaskController.cs
│ │ │ ├── TenantController.cs
│ │ │ ├── UserController.cs
│ │ │ └── UserLoginController.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Startup.cs
│ │ ├── Tracker.Web.csproj
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ └── Tracker.sln
├── TrackerSchema
│ ├── TrackerSchema.Core
│ │ ├── Data
│ │ │ ├── Identity
│ │ │ │ ├── Entities
│ │ │ │ │ ├── IdentityRole.cs
│ │ │ │ │ ├── IdentityUser.cs
│ │ │ │ │ ├── IdentityUserLogin.cs
│ │ │ │ │ └── IdentityUserRole.cs
│ │ │ │ ├── Mapping
│ │ │ │ │ ├── IdentityRoleMap.cs
│ │ │ │ │ ├── IdentityUserLoginMap.cs
│ │ │ │ │ ├── IdentityUserMap.cs
│ │ │ │ │ └── IdentityUserRoleMap.cs
│ │ │ │ └── Queries
│ │ │ │ │ ├── IdentityRoleExtensions.cs
│ │ │ │ │ ├── IdentityUserExtensions.cs
│ │ │ │ │ ├── IdentityUserLoginExtensions.cs
│ │ │ │ │ └── IdentityUserRoleExtensions.cs
│ │ │ ├── Tracker
│ │ │ │ ├── Entities
│ │ │ │ │ ├── TrackerAudit.cs
│ │ │ │ │ ├── TrackerPriority.cs
│ │ │ │ │ ├── TrackerStatus.cs
│ │ │ │ │ ├── TrackerTask.cs
│ │ │ │ │ └── TrackerTaskExtended.cs
│ │ │ │ ├── Mapping
│ │ │ │ │ ├── TrackerAuditMap.cs
│ │ │ │ │ ├── TrackerPriorityMap.cs
│ │ │ │ │ ├── TrackerStatusMap.cs
│ │ │ │ │ ├── TrackerTaskExtendedMap.cs
│ │ │ │ │ └── TrackerTaskMap.cs
│ │ │ │ └── Queries
│ │ │ │ │ ├── TrackerAuditExtensions.cs
│ │ │ │ │ ├── TrackerPriorityExtensions.cs
│ │ │ │ │ ├── TrackerStatusExtensions.cs
│ │ │ │ │ ├── TrackerTaskExtendedExtensions.cs
│ │ │ │ │ └── TrackerTaskExtensions.cs
│ │ │ └── TrackerSchemaContext.cs
│ │ ├── Domain
│ │ │ ├── Identity
│ │ │ │ ├── Mapping
│ │ │ │ │ ├── IdentityRoleProfile.cs
│ │ │ │ │ ├── IdentityUserLoginProfile.cs
│ │ │ │ │ ├── IdentityUserProfile.cs
│ │ │ │ │ └── IdentityUserRoleProfile.cs
│ │ │ │ ├── Models
│ │ │ │ │ ├── IdentityRoleCreateModel.cs
│ │ │ │ │ ├── IdentityRoleReadModel.cs
│ │ │ │ │ ├── IdentityRoleUpdateModel.cs
│ │ │ │ │ ├── IdentityUserCreateModel.cs
│ │ │ │ │ ├── IdentityUserLoginCreateModel.cs
│ │ │ │ │ ├── IdentityUserLoginReadModel.cs
│ │ │ │ │ ├── IdentityUserLoginUpdateModel.cs
│ │ │ │ │ ├── IdentityUserReadModel.cs
│ │ │ │ │ ├── IdentityUserRoleCreateModel.cs
│ │ │ │ │ ├── IdentityUserRoleReadModel.cs
│ │ │ │ │ ├── IdentityUserRoleUpdateModel.cs
│ │ │ │ │ └── IdentityUserUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ │ ├── IdentityRoleCreateModelValidator.cs
│ │ │ │ │ ├── IdentityRoleUpdateModelValidator.cs
│ │ │ │ │ ├── IdentityUserCreateModelValidator.cs
│ │ │ │ │ ├── IdentityUserLoginCreateModelValidator.cs
│ │ │ │ │ ├── IdentityUserLoginUpdateModelValidator.cs
│ │ │ │ │ ├── IdentityUserRoleCreateModelValidator.cs
│ │ │ │ │ ├── IdentityUserRoleUpdateModelValidator.cs
│ │ │ │ │ └── IdentityUserUpdateModelValidator.cs
│ │ │ └── Tracker
│ │ │ │ ├── Mapping
│ │ │ │ ├── TrackerAuditProfile.cs
│ │ │ │ ├── TrackerPriorityProfile.cs
│ │ │ │ ├── TrackerStatusProfile.cs
│ │ │ │ ├── TrackerTaskExtendedProfile.cs
│ │ │ │ └── TrackerTaskProfile.cs
│ │ │ │ ├── Models
│ │ │ │ ├── TrackerAuditCreateModel.cs
│ │ │ │ ├── TrackerAuditReadModel.cs
│ │ │ │ ├── TrackerAuditUpdateModel.cs
│ │ │ │ ├── TrackerPriorityCreateModel.cs
│ │ │ │ ├── TrackerPriorityReadModel.cs
│ │ │ │ ├── TrackerPriorityUpdateModel.cs
│ │ │ │ ├── TrackerStatusCreateModel.cs
│ │ │ │ ├── TrackerStatusReadModel.cs
│ │ │ │ ├── TrackerStatusUpdateModel.cs
│ │ │ │ ├── TrackerTaskCreateModel.cs
│ │ │ │ ├── TrackerTaskExtendedCreateModel.cs
│ │ │ │ ├── TrackerTaskExtendedReadModel.cs
│ │ │ │ ├── TrackerTaskExtendedUpdateModel.cs
│ │ │ │ ├── TrackerTaskReadModel.cs
│ │ │ │ └── TrackerTaskUpdateModel.cs
│ │ │ │ └── Validation
│ │ │ │ ├── TrackerAuditCreateModelValidator.cs
│ │ │ │ ├── TrackerAuditUpdateModelValidator.cs
│ │ │ │ ├── TrackerPriorityCreateModelValidator.cs
│ │ │ │ ├── TrackerPriorityUpdateModelValidator.cs
│ │ │ │ ├── TrackerStatusCreateModelValidator.cs
│ │ │ │ ├── TrackerStatusUpdateModelValidator.cs
│ │ │ │ ├── TrackerTaskCreateModelValidator.cs
│ │ │ │ ├── TrackerTaskExtendedCreateModelValidator.cs
│ │ │ │ ├── TrackerTaskExtendedUpdateModelValidator.cs
│ │ │ │ └── TrackerTaskUpdateModelValidator.cs
│ │ ├── TrackerSchema.Core.csproj
│ │ └── generation.yml
│ ├── TrackerSchema.Database
│ │ ├── Program.cs
│ │ ├── Scripts
│ │ │ └── Script001.Tracker.Schema.sql
│ │ ├── TrackerSchema.Database.csproj
│ │ └── appsettings.json
│ └── TrackerSchema.sln
├── create-docker.cmd
└── docker-compose.yml
├── src
├── Directory.Build.props
├── EntityFrameworkCore.Generator.Core
│ ├── CodeGenerator.cs
│ ├── ConfigurationSerializer.cs
│ ├── EntityFrameworkCore.Generator.Core.csproj
│ ├── Extensions
│ │ ├── EnumerableExtensions.cs
│ │ ├── GenerationExtensions.cs
│ │ ├── StringExtensions.cs
│ │ └── TypeExtensions.cs
│ ├── ICodeGenerator.cs
│ ├── IConfigurationSerializer.cs
│ ├── IOptionVariable.cs
│ ├── Metadata
│ │ ├── Generation
│ │ │ ├── Cardinality.cs
│ │ │ ├── Entity.cs
│ │ │ ├── EntityCollection.cs
│ │ │ ├── EntityContext.cs
│ │ │ ├── Method.cs
│ │ │ ├── MethodCollection.cs
│ │ │ ├── Model.cs
│ │ │ ├── ModelBase.cs
│ │ │ ├── ModelCollection.cs
│ │ │ ├── ModelType.cs
│ │ │ ├── Property.cs
│ │ │ ├── PropertyCollection.cs
│ │ │ ├── Relationship.cs
│ │ │ └── RelationshipCollection.cs
│ │ └── Parsing
│ │ │ ├── CodeRegion.cs
│ │ │ ├── ParsedContext.cs
│ │ │ ├── ParsedEntity.cs
│ │ │ ├── ParsedEntitySet.cs
│ │ │ ├── ParsedProperty.cs
│ │ │ └── ParsedRelationship.cs
│ ├── ModelGenerator.cs
│ ├── OptionMapper.cs
│ ├── Options
│ │ ├── ClassOptionsBase.cs
│ │ ├── ContextClassOptions.cs
│ │ ├── ContextNaming.cs
│ │ ├── CreateModelOptions.cs
│ │ ├── DataOptions.cs
│ │ ├── DatabaseMatchOptions.cs
│ │ ├── DatabaseOptions.cs
│ │ ├── DatabaseProviders.cs
│ │ ├── EntityClassOptions.cs
│ │ ├── EntityNaming.cs
│ │ ├── GeneratorOptions.cs
│ │ ├── MapperClassOptions.cs
│ │ ├── MappingClassOptions.cs
│ │ ├── MatchOptions.cs
│ │ ├── ModelOptions.cs
│ │ ├── ModelOptionsBase.cs
│ │ ├── OptionsBase.cs
│ │ ├── ProjectOptions.cs
│ │ ├── QueryExtensionOptions.cs
│ │ ├── ReadModelOptions.cs
│ │ ├── RelationshipNaming.cs
│ │ ├── RowVersionMapping.cs
│ │ ├── ScriptOptions.cs
│ │ ├── SelectionOptions.cs
│ │ ├── SharedModelOptions.cs
│ │ ├── TableNaming.cs
│ │ ├── TemplateOptions.cs
│ │ ├── UpdateModelOptions.cs
│ │ └── ValidatorClassOptions.cs
│ ├── Parsing
│ │ ├── ContextParser.cs
│ │ ├── ContextVisitor.cs
│ │ ├── MappingParser.cs
│ │ ├── MappingVisitor.cs
│ │ ├── RegionParser.cs
│ │ ├── RegionReplace.cs
│ │ ├── RegionVisitor.cs
│ │ └── SourceSynchronizer.cs
│ ├── Scripts
│ │ ├── ContextScriptTemplate.cs
│ │ ├── ContextScriptVariables.cs
│ │ ├── EntityScriptTemplate.cs
│ │ ├── EntityScriptVariables.cs
│ │ ├── ModelScriptTemplate.cs
│ │ ├── ModelScriptVariables.cs
│ │ ├── ScriptTemplateBase.cs
│ │ └── ScriptVariablesBase.cs
│ ├── SecretsStore.cs
│ ├── Serialization
│ │ ├── ClassBase.cs
│ │ ├── ContextClass.cs
│ │ ├── CreateModel.cs
│ │ ├── DataModel.cs
│ │ ├── DatabaseMatchModel.cs
│ │ ├── DatabaseModel.cs
│ │ ├── EntityClass.cs
│ │ ├── GeneratorModel.cs
│ │ ├── MapperClass.cs
│ │ ├── MappingClass.cs
│ │ ├── MatchModel.cs
│ │ ├── ModelBase.cs
│ │ ├── ProjectModel.cs
│ │ ├── QueryExtension.cs
│ │ ├── ReadModel.cs
│ │ ├── ScriptModel.cs
│ │ ├── SelectionModel.cs
│ │ ├── SharedModel.cs
│ │ ├── TemplateModel.cs
│ │ ├── UpdateModel.cs
│ │ ├── ValidatorClass.cs
│ │ └── ViewModel.cs
│ ├── Templates
│ │ ├── CodeTemplateBase.cs
│ │ ├── DataContextTemplate.cs
│ │ ├── EntityClassTemplate.cs
│ │ ├── MapperClassTemplate.cs
│ │ ├── MappingClassTemplate.cs
│ │ ├── ModelClassTemplate.cs
│ │ ├── QueryExtensionTemplate.cs
│ │ └── ValidatorClassTemplate.cs
│ ├── UniqueNamer.cs
│ ├── VariableConstants.cs
│ └── VariableDictionary.cs
└── EntityFrameworkCore.Generator
│ ├── CommandBase.cs
│ ├── EntityFrameworkCore.Generator.csproj
│ ├── GenerateCommand.cs
│ ├── InitializeCommand.cs
│ ├── OptionsCommandBase.cs
│ ├── Program.cs
│ └── Properties
│ └── launchSettings.json
└── test
└── EntityFrameworkCore.Generator.Core.Tests
├── CodeGeneratorTests.cs
├── DatabaseCollection.cs
├── DatabaseFixture.cs
├── DatabaseTestBase.cs
├── EntityFrameworkCore.Generator.Core.Tests.csproj
├── ModelGeneratorTests.cs
├── Options
└── full.yaml
├── OptionsTests.cs
├── Parsing
├── ContextParserTests.cs
└── RegionParserTests.cs
├── Scripts
├── Script001.Tracker.Schema.sql
├── Script002.Tracker.Data.sql
└── Script003.Tracker.User.sql
├── Templates
├── EntityYamlScript.cs
├── ModelYamlScript.cs
└── TypescriptScript.cs
├── VariableDictionaryTests.cs
├── appsettings.github.json
└── appsettings.json
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: loresoft
2 |
--------------------------------------------------------------------------------
/.github/workflows/docs.yml:
--------------------------------------------------------------------------------
1 | name: Documentation
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | - develop
8 | tags:
9 | - "v*"
10 | paths:
11 | - "docs/**"
12 | - "mkdocs.yml"
13 |
14 | permissions:
15 | contents: write
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - name: Checkout
22 | uses: actions/checkout@v4
23 |
24 | - name: Setup Python
25 | uses: actions/setup-python@v5
26 | with:
27 | python-version: 3.x
28 |
29 | - name: Install mkdocs
30 | run: pip install mkdocs-material
31 |
32 | - name: Build Documentation
33 | run: mkdocs build
34 |
35 | - name: Upload Documentation
36 | if: success()
37 | uses: actions/upload-pages-artifact@v3
38 | with:
39 | name: github-pages
40 | path: "site/"
41 |
42 | pages:
43 | runs-on: ubuntu-latest
44 | needs: build
45 | if: success()
46 |
47 | permissions:
48 | pages: write
49 | id-token: write
50 |
51 | steps:
52 | - name: Deploy Documentation
53 | id: deployment
54 | uses: actions/deploy-pages@v4
55 |
56 | environment:
57 | name: github-pages
58 | url: ${{ steps.deployment.outputs.page_url }}
59 |
--------------------------------------------------------------------------------
/.github/workflows/merge.yml:
--------------------------------------------------------------------------------
1 | name: Dependabot Auto-Merge
2 | on: pull_request
3 |
4 | permissions:
5 | contents: write
6 | pull-requests: write
7 |
8 | jobs:
9 | dependabot:
10 | runs-on: ubuntu-latest
11 | if: github.actor == 'dependabot[bot]'
12 |
13 | steps:
14 | - name: Dependabot Metadata
15 | id: metadata
16 | uses: dependabot/fetch-metadata@v2
17 | with:
18 | github-token: "${{ secrets.GITHUB_TOKEN }}"
19 |
20 | - name: Dependabot Auto-Merge PRs
21 | run: gh pr merge --auto --merge "$PR_URL"
22 | env:
23 | PR_URL: ${{github.event.pull_request.html_url}}
24 | GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 LoreSoft
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/coverlet.runsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | lcov
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 | .NET Core command-line (CLI) tool to generate Entity Framework Core source files.
4 |
5 | ## Install
6 |
7 | The Entity Framework Core Generator tool is available on nuget.org via package name `EntityFrameworkCore.Generator`.
8 |
9 | To install EntityFrameworkCore.Generator, run the following command in the console
10 |
11 | dotnet tool install --global EntityFrameworkCore.Generator
12 |
13 | More information about NuGet package available at
14 |
15 |
16 | ## Features
17 |
18 | - Entity Framework Core database first model generation
19 | - Safe regeneration via region replacement
20 | - Safe Renaming via mapping file parsing
21 | - Optionally generate read, create and update models from entity
22 | - Optionally generate validation and object mapper classes
23 |
24 | ## Usage
25 |
26 | To generate source code files from your database, use the generate command with your connection string.
27 |
28 | efg generate -c
29 |
--------------------------------------------------------------------------------
/docs/md/shared.md:
--------------------------------------------------------------------------------
1 | # Shared Model Template
2 |
3 | The [Read](read.md), [Create](create.md) and [Update](update.md) model templates share the following [configuration](../configuration.md).
4 |
5 | ## Configuration
6 |
7 | Shared configuration values are applied to all the model templates.
8 |
9 | Example configuration
10 |
11 | ```YAML
12 | model:
13 | shared:
14 | exclude:
15 | entities:
16 | - 'EmailDelivery'
17 | - 'UserLogin'
18 | properties:
19 | - 'User\.PasswordHash$'
20 | - 'User\.ResetHash$'
21 | ```
22 |
23 | ### namespace
24 |
25 | The namespace for the model class. *Variables Supported*
26 |
27 | ### directory
28 |
29 | The directory location to write the source file. *Variables Supported*
30 |
31 | ### exclude
32 |
33 | The exclude configuration is a list regular expressions for entities and properties to exclude in the model.
34 |
35 | #### entities
36 |
37 | Exclude all entities that match any of the listed regular expressions.
38 |
39 | #### properties
40 |
41 | Exclude all properties that match any of the listed regular expressions. The value to match contains the parent entity the property belongs too, `Entity.Property`.
42 |
43 |
--------------------------------------------------------------------------------
/docs/providers.md:
--------------------------------------------------------------------------------
1 | # Database Providers
2 |
3 | Entity Framework Core Generator (efg) supports the following databases.
4 |
5 | * SQL Server
6 | * PostgreSQL
7 | * MySQL
8 | * Sqlite
9 |
10 | ## Database Schema
11 |
12 | The database schema is loaded from the Entity Framework Core database metadata model factory implementation of `IDatabaseModelFactory`. Entity Framework Core Generator used the the implemented interface from each of the supported providers similar to how `ef dbcontext scaffold` works.
13 |
14 | ## Usage
15 |
16 | The provider can be set via command line or via the [configuration file](configuration.md).
17 |
18 | Set via command line
19 |
20 | ```Shell
21 | efg generate -c -p
22 | ```
23 |
24 | Set in configuration file
25 |
26 | ```YAML
27 | database:
28 | connectionString: 'Data Source=(local);Initial Catalog=Tracker;Integrated Security=True'
29 | provider: SqlServer
30 | ```
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loresoft/EntityFrameworkCore.Generator/df5bb6221f0c51fc889dc2344f8fef2d62eba623/logo.png
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: Entity Framework Core Generator
2 | theme: material
3 | repo_url: https://github.com/loresoft/EntityFrameworkCore.Generator
4 |
5 | nav:
6 | - Home: index.md
7 |
8 | - Quick Start: quickStart.md
9 | - Database Connection: connectionString.md
10 | - Database Providers: providers.md
11 | - Regeneration: regeneration.md
12 | - Configuration File: configuration.md
13 | - Configuration Variables: variables.md
14 | - Command Line Reference: commands.md
15 |
16 | - EntityFramework Templates:
17 | - Data Context: ef/dataContext.md
18 | - Entity: ef/entity.md
19 | - Mapping: ef/mapping.md
20 | - Extensions: ef/extensions.md
21 |
22 | - Model Templates:
23 | - Shared Configuration: md/shared.md
24 | - Read Model: md/read.md
25 | - Create Model: md/create.md
26 | - Update Model: md/update.md
27 | - Validation: md/validation.md
28 | - Object Mapper: md/mapper.md
29 |
30 | - Script Templates: scripts.md
31 |
32 | markdown_extensions:
33 | - tables
34 | - pymdownx.highlight:
35 | anchor_linenums: true
36 | line_spans: __span
37 | pygments_lang_class: true
38 | - pymdownx.inlinehilite
39 | - pymdownx.snippets
40 | - pymdownx.superfences
41 |
--------------------------------------------------------------------------------
/sample/Templates/context-yaml.csx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loresoft/EntityFrameworkCore.Generator/df5bb6221f0c51fc889dc2344f8fef2d62eba623/sample/Templates/context-yaml.csx
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/Audit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class Audit
7 | {
8 | public Audit()
9 | {
10 | #region Generated Constructor
11 | #endregion
12 | }
13 |
14 | #region Generated Properties
15 | public Guid Id { get; set; }
16 |
17 | public DateTime Date { get; set; }
18 |
19 | public Guid? UserId { get; set; }
20 |
21 | public Guid? TaskId { get; set; }
22 |
23 | public string Content { get; set; }
24 |
25 | public string Username { get; set; }
26 |
27 | public DateTime Created { get; set; }
28 |
29 | public string CreatedBy { get; set; }
30 |
31 | public DateTime Updated { get; set; }
32 |
33 | public string UpdatedBy { get; set; }
34 |
35 | public Byte[] RowVersion { get; set; }
36 |
37 | #endregion
38 |
39 | #region Generated Relationships
40 | #endregion
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/Priority.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class Priority
7 | {
8 | public Priority()
9 | {
10 | #region Generated Constructor
11 | Tasks = new HashSet();
12 | #endregion
13 | }
14 |
15 | #region Generated Properties
16 | public Guid Id { get; set; }
17 |
18 | public string Name { get; set; }
19 |
20 | public string Description { get; set; }
21 |
22 | public int DisplayOrder { get; set; }
23 |
24 | public bool IsActive { get; set; }
25 |
26 | public DateTime Created { get; set; }
27 |
28 | public string CreatedBy { get; set; }
29 |
30 | public DateTime Updated { get; set; }
31 |
32 | public string UpdatedBy { get; set; }
33 |
34 | public Byte[] RowVersion { get; set; }
35 |
36 | #endregion
37 |
38 | #region Generated Relationships
39 | public virtual ICollection Tasks { get; set; }
40 |
41 | #endregion
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/Role.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class Role
7 | {
8 | public Role()
9 | {
10 | #region Generated Constructor
11 | UserRoles = new HashSet();
12 | #endregion
13 | }
14 |
15 | #region Generated Properties
16 | public Guid Id { get; set; }
17 |
18 | public string Name { get; set; }
19 |
20 | public string Description { get; set; }
21 |
22 | public DateTime Created { get; set; }
23 |
24 | public string CreatedBy { get; set; }
25 |
26 | public DateTime Updated { get; set; }
27 |
28 | public string UpdatedBy { get; set; }
29 |
30 | public Byte[] RowVersion { get; set; }
31 |
32 | #endregion
33 |
34 | #region Generated Relationships
35 | public virtual ICollection UserRoles { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/Status.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class Status
7 | {
8 | public Status()
9 | {
10 | #region Generated Constructor
11 | Tasks = new HashSet();
12 | #endregion
13 | }
14 |
15 | #region Generated Properties
16 | public Guid Id { get; set; }
17 |
18 | public string Name { get; set; }
19 |
20 | public string Description { get; set; }
21 |
22 | public int DisplayOrder { get; set; }
23 |
24 | public bool IsActive { get; set; }
25 |
26 | public DateTime Created { get; set; }
27 |
28 | public string CreatedBy { get; set; }
29 |
30 | public DateTime Updated { get; set; }
31 |
32 | public string UpdatedBy { get; set; }
33 |
34 | public Byte[] RowVersion { get; set; }
35 |
36 | #endregion
37 |
38 | #region Generated Relationships
39 | public virtual ICollection Tasks { get; set; }
40 |
41 | #endregion
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/TaskExtended.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class TaskExtended
7 | {
8 | public TaskExtended()
9 | {
10 | #region Generated Constructor
11 | #endregion
12 | }
13 |
14 | #region Generated Properties
15 | public Guid TaskId { get; set; }
16 |
17 | public string UserAgent { get; set; }
18 |
19 | public string Browser { get; set; }
20 |
21 | public string OperatingSystem { get; set; }
22 |
23 | public DateTime Created { get; set; }
24 |
25 | public string CreatedBy { get; set; }
26 |
27 | public DateTime Updated { get; set; }
28 |
29 | public string UpdatedBy { get; set; }
30 |
31 | public Byte[] RowVersion { get; set; }
32 |
33 | #endregion
34 |
35 | #region Generated Relationships
36 | public virtual Task Task { get; set; }
37 |
38 | #endregion
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Entities/UserRole.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Data.Entities
5 | {
6 | public partial class UserRole
7 | {
8 | public UserRole()
9 | {
10 | #region Generated Constructor
11 | #endregion
12 | }
13 |
14 | #region Generated Properties
15 | public Guid UserId { get; set; }
16 |
17 | public Guid RoleId { get; set; }
18 |
19 | #endregion
20 |
21 | #region Generated Relationships
22 | public virtual Role Role { get; set; }
23 |
24 | public virtual User User { get; set; }
25 |
26 | #endregion
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Queries/AuditExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.EntityFrameworkCore;
6 |
7 | namespace Tracker.PostgreSQL.Core.Data.Queries
8 | {
9 | public static partial class AuditExtensions
10 | {
11 | #region Generated Extensions
12 | public static Tracker.PostgreSQL.Core.Data.Entities.Audit GetByKey(this IQueryable queryable, Guid id)
13 | {
14 | if (queryable is DbSet dbSet)
15 | return dbSet.Find(id);
16 |
17 | return queryable.FirstOrDefault(q => q.Id == id);
18 | }
19 |
20 | public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
21 | {
22 | if (queryable is DbSet dbSet)
23 | return dbSet.FindAsync(id);
24 |
25 | var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
26 | return new ValueTask(task);
27 | }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Data/Queries/StatusExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.EntityFrameworkCore;
6 |
7 | namespace Tracker.PostgreSQL.Core.Data.Queries
8 | {
9 | public static partial class StatusExtensions
10 | {
11 | #region Generated Extensions
12 | public static Tracker.PostgreSQL.Core.Data.Entities.Status GetByKey(this IQueryable queryable, Guid id)
13 | {
14 | if (queryable is DbSet dbSet)
15 | return dbSet.Find(id);
16 |
17 | return queryable.FirstOrDefault(q => q.Id == id);
18 | }
19 |
20 | public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
21 | {
22 | if (queryable is DbSet dbSet)
23 | return dbSet.FindAsync(id);
24 |
25 | var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
26 | return new ValueTask(task);
27 | }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/AuditProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class AuditProfile
9 | : AutoMapper.Profile
10 | {
11 | public AuditProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/PriorityProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class PriorityProfile
9 | : AutoMapper.Profile
10 | {
11 | public PriorityProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/RoleProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class RoleProfile
9 | : AutoMapper.Profile
10 | {
11 | public RoleProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/StatusProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class StatusProfile
9 | : AutoMapper.Profile
10 | {
11 | public StatusProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/TaskExtendedProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class TaskExtendedProfile
9 | : AutoMapper.Profile
10 | {
11 | public TaskExtendedProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/TaskProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class TaskProfile
9 | : AutoMapper.Profile
10 | {
11 | public TaskProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/UserLoginProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class UserLoginProfile
9 | : AutoMapper.Profile
10 | {
11 | public UserLoginProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/UserProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class UserProfile
9 | : AutoMapper.Profile
10 | {
11 | public UserProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Mapping/UserRoleProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.PostgreSQL.Core.Data.Entities;
4 | using Tracker.PostgreSQL.Core.Domain.Models;
5 |
6 | namespace Tracker.PostgreSQL.Core.Domain.Mapping
7 | {
8 | public partial class UserRoleProfile
9 | : AutoMapper.Profile
10 | {
11 | public UserRoleProfile()
12 | {
13 | CreateMap();
14 |
15 | CreateMap();
16 |
17 | CreateMap();
18 |
19 | CreateMap();
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/AuditCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class AuditCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public DateTime Date { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public Guid? TaskId { get; set; }
16 |
17 | public string Content { get; set; }
18 |
19 | public string Username { get; set; }
20 |
21 | public DateTime Created { get; set; }
22 |
23 | public string CreatedBy { get; set; }
24 |
25 | public DateTime Updated { get; set; }
26 |
27 | public string UpdatedBy { get; set; }
28 |
29 | public Byte[] RowVersion { get; set; }
30 |
31 | #endregion
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/AuditReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class AuditReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public DateTime Date { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public Guid? TaskId { get; set; }
16 |
17 | public string Content { get; set; }
18 |
19 | public string Username { get; set; }
20 |
21 | public DateTime Created { get; set; }
22 |
23 | public string CreatedBy { get; set; }
24 |
25 | public DateTime Updated { get; set; }
26 |
27 | public string UpdatedBy { get; set; }
28 |
29 | public Byte[] RowVersion { get; set; }
30 |
31 | #endregion
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/AuditUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class AuditUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public DateTime Date { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public Guid? TaskId { get; set; }
16 |
17 | public string Content { get; set; }
18 |
19 | public string Username { get; set; }
20 |
21 | public DateTime Created { get; set; }
22 |
23 | public string CreatedBy { get; set; }
24 |
25 | public DateTime Updated { get; set; }
26 |
27 | public string UpdatedBy { get; set; }
28 |
29 | public Byte[] RowVersion { get; set; }
30 |
31 | #endregion
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/PriorityCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class PriorityCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/PriorityReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class PriorityReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/PriorityUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class PriorityUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/RoleCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class RoleCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; }
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; }
22 |
23 | public Byte[] RowVersion { get; set; }
24 |
25 | #endregion
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/RoleReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class RoleReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; }
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; }
22 |
23 | public Byte[] RowVersion { get; set; }
24 |
25 | #endregion
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/RoleUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class RoleUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; }
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; }
22 |
23 | public Byte[] RowVersion { get; set; }
24 |
25 | #endregion
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/StatusCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class StatusCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/StatusReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class StatusReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/StatusUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class StatusUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public int DisplayOrder { get; set; }
16 |
17 | public bool IsActive { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; }
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; }
26 |
27 | public Byte[] RowVersion { get; set; }
28 |
29 | #endregion
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public Guid StatusId { get; set; }
12 |
13 | public Guid? PriorityId { get; set; }
14 |
15 | public string Title { get; set; }
16 |
17 | public string Description { get; set; }
18 |
19 | public DateTime? StartDate { get; set; }
20 |
21 | public DateTime? DueDate { get; set; }
22 |
23 | public DateTime? CompleteDate { get; set; }
24 |
25 | public Guid? AssignedId { get; set; }
26 |
27 | public DateTime Created { get; set; }
28 |
29 | public string CreatedBy { get; set; }
30 |
31 | public DateTime Updated { get; set; }
32 |
33 | public string UpdatedBy { get; set; }
34 |
35 | public Byte[] RowVersion { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskExtendedCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskExtendedCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid TaskId { get; set; }
10 |
11 | public string UserAgent { get; set; }
12 |
13 | public string Browser { get; set; }
14 |
15 | public string OperatingSystem { get; set; }
16 |
17 | public DateTime Created { get; set; }
18 |
19 | public string CreatedBy { get; set; }
20 |
21 | public DateTime Updated { get; set; }
22 |
23 | public string UpdatedBy { get; set; }
24 |
25 | public Byte[] RowVersion { get; set; }
26 |
27 | #endregion
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskExtendedReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskExtendedReadModel
7 | {
8 | #region Generated Properties
9 | public Guid TaskId { get; set; }
10 |
11 | public string UserAgent { get; set; }
12 |
13 | public string Browser { get; set; }
14 |
15 | public string OperatingSystem { get; set; }
16 |
17 | public DateTime Created { get; set; }
18 |
19 | public string CreatedBy { get; set; }
20 |
21 | public DateTime Updated { get; set; }
22 |
23 | public string UpdatedBy { get; set; }
24 |
25 | public Byte[] RowVersion { get; set; }
26 |
27 | #endregion
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskExtendedUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskExtendedUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid TaskId { get; set; }
10 |
11 | public string UserAgent { get; set; }
12 |
13 | public string Browser { get; set; }
14 |
15 | public string OperatingSystem { get; set; }
16 |
17 | public DateTime Created { get; set; }
18 |
19 | public string CreatedBy { get; set; }
20 |
21 | public DateTime Updated { get; set; }
22 |
23 | public string UpdatedBy { get; set; }
24 |
25 | public Byte[] RowVersion { get; set; }
26 |
27 | #endregion
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public Guid StatusId { get; set; }
12 |
13 | public Guid? PriorityId { get; set; }
14 |
15 | public string Title { get; set; }
16 |
17 | public string Description { get; set; }
18 |
19 | public DateTime? StartDate { get; set; }
20 |
21 | public DateTime? DueDate { get; set; }
22 |
23 | public DateTime? CompleteDate { get; set; }
24 |
25 | public Guid? AssignedId { get; set; }
26 |
27 | public DateTime Created { get; set; }
28 |
29 | public string CreatedBy { get; set; }
30 |
31 | public DateTime Updated { get; set; }
32 |
33 | public string UpdatedBy { get; set; }
34 |
35 | public Byte[] RowVersion { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/TaskUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class TaskUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public Guid StatusId { get; set; }
12 |
13 | public Guid? PriorityId { get; set; }
14 |
15 | public string Title { get; set; }
16 |
17 | public string Description { get; set; }
18 |
19 | public DateTime? StartDate { get; set; }
20 |
21 | public DateTime? DueDate { get; set; }
22 |
23 | public DateTime? CompleteDate { get; set; }
24 |
25 | public Guid? AssignedId { get; set; }
26 |
27 | public DateTime Created { get; set; }
28 |
29 | public string CreatedBy { get; set; }
30 |
31 | public DateTime Updated { get; set; }
32 |
33 | public string UpdatedBy { get; set; }
34 |
35 | public Byte[] RowVersion { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public bool IsEmailAddressConfirmed { get; set; }
14 |
15 | public string DisplayName { get; set; }
16 |
17 | public string PasswordHash { get; set; }
18 |
19 | public string ResetHash { get; set; }
20 |
21 | public string InviteHash { get; set; }
22 |
23 | public int AccessFailedCount { get; set; }
24 |
25 | public bool LockoutEnabled { get; set; }
26 |
27 | public DateTime? LockoutEnd { get; set; }
28 |
29 | public DateTime? LastLogin { get; set; }
30 |
31 | public bool IsDeleted { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserLoginCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserLoginCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public string UserAgent { get; set; }
16 |
17 | public string Browser { get; set; }
18 |
19 | public string OperatingSystem { get; set; }
20 |
21 | public string DeviceFamily { get; set; }
22 |
23 | public string DeviceBrand { get; set; }
24 |
25 | public string DeviceModel { get; set; }
26 |
27 | public string IpAddress { get; set; }
28 |
29 | public bool IsSuccessful { get; set; }
30 |
31 | public string FailureMessage { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserLoginReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserLoginReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public string UserAgent { get; set; }
16 |
17 | public string Browser { get; set; }
18 |
19 | public string OperatingSystem { get; set; }
20 |
21 | public string DeviceFamily { get; set; }
22 |
23 | public string DeviceBrand { get; set; }
24 |
25 | public string DeviceModel { get; set; }
26 |
27 | public string IpAddress { get; set; }
28 |
29 | public bool IsSuccessful { get; set; }
30 |
31 | public string FailureMessage { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserLoginUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserLoginUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public Guid? UserId { get; set; }
14 |
15 | public string UserAgent { get; set; }
16 |
17 | public string Browser { get; set; }
18 |
19 | public string OperatingSystem { get; set; }
20 |
21 | public string DeviceFamily { get; set; }
22 |
23 | public string DeviceBrand { get; set; }
24 |
25 | public string DeviceModel { get; set; }
26 |
27 | public string IpAddress { get; set; }
28 |
29 | public bool IsSuccessful { get; set; }
30 |
31 | public string FailureMessage { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserReadModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public bool IsEmailAddressConfirmed { get; set; }
14 |
15 | public string DisplayName { get; set; }
16 |
17 | public string PasswordHash { get; set; }
18 |
19 | public string ResetHash { get; set; }
20 |
21 | public string InviteHash { get; set; }
22 |
23 | public int AccessFailedCount { get; set; }
24 |
25 | public bool LockoutEnabled { get; set; }
26 |
27 | public DateTime? LockoutEnd { get; set; }
28 |
29 | public DateTime? LastLogin { get; set; }
30 |
31 | public bool IsDeleted { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserRoleCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserRoleCreateModel
7 | {
8 | #region Generated Properties
9 | public Guid UserId { get; set; }
10 |
11 | public Guid RoleId { get; set; }
12 |
13 | #endregion
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserRoleReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserRoleReadModel
7 | {
8 | #region Generated Properties
9 | public Guid UserId { get; set; }
10 |
11 | public Guid RoleId { get; set; }
12 |
13 | #endregion
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserRoleUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserRoleUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid UserId { get; set; }
10 |
11 | public Guid RoleId { get; set; }
12 |
13 | #endregion
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Models/UserUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.PostgreSQL.Core.Domain.Models
5 | {
6 | public partial class UserUpdateModel
7 | {
8 | #region Generated Properties
9 | public Guid Id { get; set; }
10 |
11 | public string EmailAddress { get; set; }
12 |
13 | public bool IsEmailAddressConfirmed { get; set; }
14 |
15 | public string DisplayName { get; set; }
16 |
17 | public string PasswordHash { get; set; }
18 |
19 | public string ResetHash { get; set; }
20 |
21 | public string InviteHash { get; set; }
22 |
23 | public int AccessFailedCount { get; set; }
24 |
25 | public bool LockoutEnabled { get; set; }
26 |
27 | public DateTime? LockoutEnd { get; set; }
28 |
29 | public DateTime? LastLogin { get; set; }
30 |
31 | public bool IsDeleted { get; set; }
32 |
33 | public DateTime Created { get; set; }
34 |
35 | public string CreatedBy { get; set; }
36 |
37 | public DateTime Updated { get; set; }
38 |
39 | public string UpdatedBy { get; set; }
40 |
41 | public Byte[] RowVersion { get; set; }
42 |
43 | #endregion
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/AuditCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class AuditCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public AuditCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Content).NotEmpty();
14 | RuleFor(p => p.Username).NotEmpty();
15 | RuleFor(p => p.Username).MaximumLength(50);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/AuditUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class AuditUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public AuditUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Content).NotEmpty();
14 | RuleFor(p => p.Username).NotEmpty();
15 | RuleFor(p => p.Username).MaximumLength(50);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/PriorityCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class PriorityCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public PriorityCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(100);
15 | RuleFor(p => p.Description).MaximumLength(255);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/PriorityUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class PriorityUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public PriorityUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(100);
15 | RuleFor(p => p.Description).MaximumLength(255);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/RoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class RoleCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public RoleCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(256);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/RoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class RoleUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public RoleUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(256);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/StatusCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class StatusCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public StatusCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(100);
15 | RuleFor(p => p.Description).MaximumLength(255);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/StatusUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class StatusUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public StatusUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Name).NotEmpty();
14 | RuleFor(p => p.Name).MaximumLength(100);
15 | RuleFor(p => p.Description).MaximumLength(255);
16 | RuleFor(p => p.CreatedBy).MaximumLength(100);
17 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
18 | #endregion
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/TaskCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class TaskCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public TaskCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Title).NotEmpty();
14 | RuleFor(p => p.Title).MaximumLength(255);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/TaskExtendedCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class TaskExtendedCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public TaskExtendedCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Browser).MaximumLength(256);
14 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/TaskExtendedUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class TaskExtendedUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public TaskExtendedUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Browser).MaximumLength(256);
14 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/TaskUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class TaskUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public TaskUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.Title).NotEmpty();
14 | RuleFor(p => p.Title).MaximumLength(255);
15 | RuleFor(p => p.CreatedBy).MaximumLength(100);
16 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
17 | #endregion
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.EmailAddress).NotEmpty();
14 | RuleFor(p => p.EmailAddress).MaximumLength(256);
15 | RuleFor(p => p.DisplayName).NotEmpty();
16 | RuleFor(p => p.DisplayName).MaximumLength(256);
17 | RuleFor(p => p.CreatedBy).MaximumLength(100);
18 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
19 | #endregion
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserLoginCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserLoginCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserLoginCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.EmailAddress).NotEmpty();
14 | RuleFor(p => p.EmailAddress).MaximumLength(256);
15 | RuleFor(p => p.Browser).MaximumLength(256);
16 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
17 | RuleFor(p => p.DeviceFamily).MaximumLength(256);
18 | RuleFor(p => p.DeviceBrand).MaximumLength(256);
19 | RuleFor(p => p.DeviceModel).MaximumLength(256);
20 | RuleFor(p => p.IpAddress).MaximumLength(50);
21 | RuleFor(p => p.FailureMessage).MaximumLength(256);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserLoginUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserLoginUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserLoginUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.EmailAddress).NotEmpty();
14 | RuleFor(p => p.EmailAddress).MaximumLength(256);
15 | RuleFor(p => p.Browser).MaximumLength(256);
16 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
17 | RuleFor(p => p.DeviceFamily).MaximumLength(256);
18 | RuleFor(p => p.DeviceBrand).MaximumLength(256);
19 | RuleFor(p => p.DeviceModel).MaximumLength(256);
20 | RuleFor(p => p.IpAddress).MaximumLength(50);
21 | RuleFor(p => p.FailureMessage).MaximumLength(256);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserRoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserRoleCreateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserRoleCreateModelValidator()
11 | {
12 | #region Generated Constructor
13 | #endregion
14 | }
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserRoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserRoleUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserRoleUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | #endregion
14 | }
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Domain/Validation/UserUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.PostgreSQL.Core.Domain.Models;
4 |
5 | namespace Tracker.PostgreSQL.Core.Domain.Validation
6 | {
7 | public partial class UserUpdateModelValidator
8 | : AbstractValidator
9 | {
10 | public UserUpdateModelValidator()
11 | {
12 | #region Generated Constructor
13 | RuleFor(p => p.EmailAddress).NotEmpty();
14 | RuleFor(p => p.EmailAddress).MaximumLength(256);
15 | RuleFor(p => p.DisplayName).NotEmpty();
16 | RuleFor(p => p.DisplayName).MaximumLength(256);
17 | RuleFor(p => p.CreatedBy).MaximumLength(100);
18 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
19 | #endregion
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Core/Tracker.PostgreSQL.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Database/Tracker.PostgreSQL.Database.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | PreserveNewest
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/sample/Tracker.PostgreSQL/Tracker.PostgreSQL.Database/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "Tracker": "Server=ares;Port=5432;Database=Tracker;User Id=postgres;Password=!p@ssword;"
4 | }
5 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Definitions/IHaveIdentifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tracker.Core.Definitions;
4 |
5 | public interface IHaveIdentifier
6 | {
7 | Guid Id { get; set; }
8 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Definitions/ITrackConcurrency.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tracker.Core.Definitions;
4 |
5 | public interface ITrackConcurrency
6 | {
7 | string RowVersion { get; set; }
8 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Definitions/ITrackCreated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tracker.Core.Definitions;
4 |
5 | public interface ITrackCreated
6 | {
7 | DateTimeOffset Created { get; set; }
8 | string? CreatedBy { get; set; }
9 | }
10 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Definitions/ITrackDeleted.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tracker.Core.Definitions;
4 |
5 | public interface ITrackDeleted
6 | {
7 | bool IsDeleted { get; set; }
8 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Definitions/ITrackUpdated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tracker.Core.Definitions;
4 |
5 | public interface ITrackUpdated
6 | {
7 | DateTimeOffset Updated { get; set; }
8 | string? UpdatedBy { get; set; }
9 | }
10 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Audit/Mapping/AuditProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class AuditProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public AuditProfile()
19 | {
20 | CreateMap();
21 | CreateMap();
22 | CreateMap();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Audit/Validation/AuditCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 |
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | [RegisterSingleton>]
12 | public partial class AuditCreateModelValidator
13 | : AbstractValidator
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public AuditCreateModelValidator()
19 | {
20 | #region Generated Constructor
21 | RuleFor(p => p.Content).NotEmpty();
22 | RuleFor(p => p.Username).NotEmpty();
23 | RuleFor(p => p.Username).MaximumLength(50);
24 | #endregion
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Audit/Validation/AuditUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Core.Domain.Validation;
6 |
7 | ///
8 | /// Validator class for .
9 | ///
10 | [RegisterSingleton>]
11 | public partial class AuditUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public AuditUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Content).NotEmpty();
21 | RuleFor(p => p.Username).NotEmpty();
22 | RuleFor(p => p.Username).MaximumLength(50);
23 | #endregion
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/EntityCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tracker.Core.Definitions;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | public class EntityCreateModel : IHaveIdentifier, ITrackCreated, ITrackUpdated
8 | {
9 | public Guid Id { get; set; }
10 |
11 | public DateTimeOffset Created { get; set; }
12 |
13 | public string? CreatedBy { get; set; }
14 |
15 | public DateTimeOffset Updated { get; set; }
16 |
17 | public string? UpdatedBy { get; set; }
18 | }
19 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/EntityReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tracker.Core.Definitions;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | public class EntityReadModel : IHaveIdentifier, ITrackCreated, ITrackUpdated, ITrackConcurrency
8 | {
9 | public Guid Id { get; set; }
10 |
11 | public DateTimeOffset Created { get; set; } = DateTimeOffset.UtcNow;
12 |
13 | public string? CreatedBy { get; set; }
14 |
15 | public DateTimeOffset Updated { get; set; } = DateTimeOffset.UtcNow;
16 |
17 | public string? UpdatedBy { get; set; }
18 |
19 | public string RowVersion { get; set; } = null!;
20 | }
21 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/EntityUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tracker.Core.Definitions;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | public class EntityUpdateModel : IHaveIdentifier, ITrackCreated, ITrackUpdated, ITrackConcurrency
8 | {
9 | public Guid Id { get; set; }
10 |
11 | public DateTimeOffset Created { get; set; } = DateTimeOffset.UtcNow;
12 |
13 | public string? CreatedBy { get; set; }
14 |
15 | public DateTimeOffset Updated { get; set; } = DateTimeOffset.UtcNow;
16 |
17 | public string? UpdatedBy { get; set; }
18 |
19 | public string RowVersion { get; set; } = null!;
20 | }
21 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Priority/Mapping/PriorityProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class PriorityProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public PriorityProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 |
23 | CreateMap();
24 |
25 | CreateMap()
26 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Priority/Validation/PriorityCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class PriorityCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public PriorityCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(100);
22 | RuleFor(p => p.Description).MaximumLength(255);
23 | #endregion
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Priority/Validation/PriorityUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class PriorityUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public PriorityUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(100);
22 | RuleFor(p => p.Description).MaximumLength(255);
23 | #endregion
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Mapping/RoleProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class RoleProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public RoleProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 |
23 | CreateMap();
24 |
25 | CreateMap()
26 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Models/RoleCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class RoleCreateModel
11 | : EntityCreateModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'Name'.
16 | ///
17 | ///
18 | /// The property value for 'Name'.
19 | ///
20 | public string Name { get; set; } = null!;
21 |
22 | ///
23 | /// Gets or sets the property value for 'Description'.
24 | ///
25 | ///
26 | /// The property value for 'Description'.
27 | ///
28 | public string? Description { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Models/RoleReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class RoleReadModel
11 | : EntityReadModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'Name'.
16 | ///
17 | ///
18 | /// The property value for 'Name'.
19 | ///
20 | public string Name { get; set; } = null!;
21 |
22 | ///
23 | /// Gets or sets the property value for 'Description'.
24 | ///
25 | ///
26 | /// The property value for 'Description'.
27 | ///
28 | public string? Description { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Models/RoleUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class RoleUpdateModel
11 | : EntityUpdateModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'Name'.
16 | ///
17 | ///
18 | /// The property value for 'Name'.
19 | ///
20 | public string Name { get; set; } = null!;
21 |
22 | ///
23 | /// Gets or sets the property value for 'Description'.
24 | ///
25 | ///
26 | /// The property value for 'Description'.
27 | ///
28 | public string? Description { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Validation/RoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class RoleCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public RoleCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(256);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Role/Validation/RoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class RoleUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public RoleUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(256);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Status/Mapping/StatusProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class StatusProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public StatusProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 |
23 | CreateMap();
24 |
25 | CreateMap()
26 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Status/Validation/StatusCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class StatusCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public StatusCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(100);
22 | RuleFor(p => p.Description).MaximumLength(255);
23 | #endregion
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Status/Validation/StatusUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class StatusUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public StatusUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Name).NotEmpty();
21 | RuleFor(p => p.Name).MaximumLength(100);
22 | RuleFor(p => p.Description).MaximumLength(255);
23 | #endregion
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Task/Mapping/TaskProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using AutoMapper;
4 |
5 | using Tracker.Core.Data.Entities;
6 | using Tracker.Core.Domain.Models;
7 |
8 | // ReSharper disable once CheckNamespace
9 | namespace Tracker.Core.Domain.Mapping;
10 |
11 | ///
12 | /// Mapper class for entity .
13 | ///
14 | public partial class TaskProfile
15 | : Profile
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | public TaskProfile()
21 | {
22 | CreateMap()
23 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)))
24 | .ForMember(d => d.PriorityName, opt => opt.MapFrom(s => s.Priority != null ? s.Priority.Name : default))
25 | .ForMember(d => d.StatusName, opt => opt.MapFrom(s => s.Status.Name))
26 | .ForMember(d => d.AssignedEmail, opt => opt.MapFrom(s => s.AssignedUser != null ? s.AssignedUser.EmailAddress : default));
27 |
28 | CreateMap();
29 |
30 | CreateMap()
31 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Task/Validation/TaskCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class TaskCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TaskCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Title).NotEmpty();
21 | RuleFor(p => p.Title).MaximumLength(255);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Task/Validation/TaskUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class TaskUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TaskUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Title).NotEmpty();
21 | RuleFor(p => p.Title).MaximumLength(255);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/TaskExtended/Mapping/TaskExtendedProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class TaskExtendedProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public TaskExtendedProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 |
23 | CreateMap();
24 |
25 | CreateMap()
26 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/TaskExtended/Validation/TaskExtendedCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class TaskExtendedCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TaskExtendedCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Browser).MaximumLength(256);
21 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/TaskExtended/Validation/TaskExtendedUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class TaskExtendedUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TaskExtendedUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.Browser).MaximumLength(256);
21 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
22 | #endregion
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Mapping/TenantProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Core.Domain.Mapping;
7 |
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class TenantProfile
12 | : Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TenantProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Models/TenantCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Core.Domain.Models;
5 |
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class TenantCreateModel
10 | : EntityCreateModel
11 | {
12 | #region Generated Properties
13 | ///
14 | /// Gets or sets the property value for 'Name'.
15 | ///
16 | ///
17 | /// The property value for 'Name'.
18 | ///
19 | public string Name { get; set; } = null!;
20 |
21 | ///
22 | /// Gets or sets the property value for 'Description'.
23 | ///
24 | ///
25 | /// The property value for 'Description'.
26 | ///
27 | public string? Description { get; set; }
28 |
29 | ///
30 | /// Gets or sets the property value for 'IsActive'.
31 | ///
32 | ///
33 | /// The property value for 'IsActive'.
34 | ///
35 | public bool IsActive { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Models/TenantReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Core.Domain.Models;
5 |
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class TenantReadModel
10 | : EntityReadModel
11 | {
12 | #region Generated Properties
13 | ///
14 | /// Gets or sets the property value for 'Name'.
15 | ///
16 | ///
17 | /// The property value for 'Name'.
18 | ///
19 | public string Name { get; set; } = null!;
20 |
21 | ///
22 | /// Gets or sets the property value for 'Description'.
23 | ///
24 | ///
25 | /// The property value for 'Description'.
26 | ///
27 | public string? Description { get; set; }
28 |
29 | ///
30 | /// Gets or sets the property value for 'IsActive'.
31 | ///
32 | ///
33 | /// The property value for 'IsActive'.
34 | ///
35 | public bool IsActive { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Models/TenantUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Core.Domain.Models;
5 |
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class TenantUpdateModel
10 | : EntityUpdateModel
11 | {
12 | #region Generated Properties
13 | ///
14 | /// Gets or sets the property value for 'Name'.
15 | ///
16 | ///
17 | /// The property value for 'Name'.
18 | ///
19 | public string Name { get; set; } = null!;
20 |
21 | ///
22 | /// Gets or sets the property value for 'Description'.
23 | ///
24 | ///
25 | /// The property value for 'Description'.
26 | ///
27 | public string? Description { get; set; }
28 |
29 | ///
30 | /// Gets or sets the property value for 'IsActive'.
31 | ///
32 | ///
33 | /// The property value for 'IsActive'.
34 | ///
35 | public bool IsActive { get; set; }
36 |
37 | #endregion
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Validation/TenantCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Core.Domain.Validation;
6 |
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TenantCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TenantCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(256);
21 | #endregion
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/Tenant/Validation/TenantUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Core.Domain.Validation;
6 |
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TenantUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TenantUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(256);
21 | #endregion
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/User/Mapping/UserProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class UserProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public UserProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 |
23 | CreateMap();
24 |
25 | CreateMap()
26 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.FromBase64String(s.RowVersion)));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/User/Validation/UserCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class UserCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public UserCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.EmailAddress).NotEmpty();
21 | RuleFor(p => p.EmailAddress).MaximumLength(256);
22 | RuleFor(p => p.DisplayName).NotEmpty();
23 | RuleFor(p => p.DisplayName).MaximumLength(256);
24 | #endregion
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/User/Validation/UserUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class UserUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public UserUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | RuleFor(p => p.EmailAddress).NotEmpty();
21 | RuleFor(p => p.EmailAddress).MaximumLength(256);
22 | RuleFor(p => p.DisplayName).NotEmpty();
23 | RuleFor(p => p.DisplayName).MaximumLength(256);
24 | #endregion
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserLogin/Mapping/UserLoginProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class UserLoginProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public UserLoginProfile()
19 | {
20 | CreateMap()
21 | .ForMember(d => d.RowVersion, opt => opt.MapFrom(s => Convert.ToBase64String(s.RowVersion)));
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Mapping/UserRoleProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using Tracker.Core.Data.Entities;
4 | using Tracker.Core.Domain.Models;
5 |
6 | // ReSharper disable once CheckNamespace
7 | namespace Tracker.Core.Domain.Mapping;
8 |
9 | ///
10 | /// Mapper class for entity .
11 | ///
12 | public partial class UserRoleProfile
13 | : Profile
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public UserRoleProfile()
19 | {
20 | CreateMap();
21 | CreateMap();
22 | CreateMap();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Models/UserRoleCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class UserRoleCreateModel
11 | : EntityCreateModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'UserId'.
16 | ///
17 | ///
18 | /// The property value for 'UserId'.
19 | ///
20 | public Guid UserId { get; set; }
21 |
22 | ///
23 | /// Gets or sets the property value for 'RoleId'.
24 | ///
25 | ///
26 | /// The property value for 'RoleId'.
27 | ///
28 | public Guid RoleId { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Models/UserRoleReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class UserRoleReadModel
11 | : EntityReadModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'UserId'.
16 | ///
17 | ///
18 | /// The property value for 'UserId'.
19 | ///
20 | public Guid UserId { get; set; }
21 |
22 | ///
23 | /// Gets or sets the property value for 'RoleId'.
24 | ///
25 | ///
26 | /// The property value for 'RoleId'.
27 | ///
28 | public Guid RoleId { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Models/UserRoleUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | // ReSharper disable once CheckNamespace
5 | namespace Tracker.Core.Domain.Models;
6 |
7 | ///
8 | /// View Model class
9 | ///
10 | public partial class UserRoleUpdateModel
11 | : EntityUpdateModel
12 | {
13 | #region Generated Properties
14 | ///
15 | /// Gets or sets the property value for 'UserId'.
16 | ///
17 | ///
18 | /// The property value for 'UserId'.
19 | ///
20 | public Guid UserId { get; set; }
21 |
22 | ///
23 | /// Gets or sets the property value for 'RoleId'.
24 | ///
25 | ///
26 | /// The property value for 'RoleId'.
27 | ///
28 | public Guid RoleId { get; set; }
29 |
30 | #endregion
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Validation/UserRoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class UserRoleCreateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public UserRoleCreateModelValidator()
18 | {
19 | #region Generated Constructor
20 | #endregion
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Domain/UserRole/Validation/UserRoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using Tracker.Core.Domain.Models;
4 |
5 | // ReSharper disable once CheckNamespace
6 | namespace Tracker.Core.Domain.Validation;
7 |
8 | ///
9 | /// Validator class for .
10 | ///
11 | public partial class UserRoleUpdateModelValidator
12 | : AbstractValidator
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public UserRoleUpdateModelValidator()
18 | {
19 | #region Generated Constructor
20 | #endregion
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Core/Tracker.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Database/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | using DbUp;
5 |
6 | using Microsoft.Extensions.Configuration;
7 |
8 | namespace Tracker.Database;
9 |
10 | public static class Program
11 | {
12 | static int Main(string[] args)
13 | {
14 | var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development";
15 | var builder = new ConfigurationBuilder()
16 | .AddJsonFile("appsettings.json")
17 | .AddJsonFile($"appsettings.{environmentName}.json", true)
18 | .AddEnvironmentVariables();
19 |
20 | var configuration = builder.Build();
21 |
22 | var connectionString = configuration.GetConnectionString("Tracker");
23 |
24 | EnsureDatabase.For
25 | .SqlDatabase(connectionString);
26 |
27 | var upgradeEngine = DeployChanges.To
28 | .SqlDatabase(connectionString)
29 | .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
30 | .LogToConsole()
31 | .Build();
32 |
33 | var result = upgradeEngine.PerformUpgrade();
34 |
35 | if (result.Successful)
36 | return 0;
37 |
38 | Console.Error.WriteLine($"Exception: '{result.Error}'");
39 |
40 | return 1;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Database/Tracker.Database.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | Always
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Database/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "Tracker": "Data Source=(local);Initial Catalog=TrackerGenerator;Integrated Security=True;TrustServerCertificate=True"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Audit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Audit
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public DateTime Date { get; set; }
11 |
12 | public Guid? UserId { get; set; }
13 |
14 | public Guid? TaskId { get; set; }
15 |
16 | public string Content { get; set; } = null!;
17 |
18 | public string Username { get; set; } = null!;
19 |
20 | public DateTimeOffset Created { get; set; }
21 |
22 | public string? CreatedBy { get; set; }
23 |
24 | public DateTimeOffset Updated { get; set; }
25 |
26 | public string? UpdatedBy { get; set; }
27 |
28 | public byte[] RowVersion { get; set; } = null!;
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Priority.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Priority
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public int DisplayOrder { get; set; }
15 |
16 | public bool IsActive { get; set; }
17 |
18 | public DateTimeOffset Created { get; set; }
19 |
20 | public string? CreatedBy { get; set; }
21 |
22 | public DateTimeOffset Updated { get; set; }
23 |
24 | public string? UpdatedBy { get; set; }
25 |
26 | public byte[] RowVersion { get; set; } = null!;
27 |
28 | public virtual ICollection Tasks { get; set; } = new List();
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Role.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Role
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public DateTimeOffset Created { get; set; }
15 |
16 | public string? CreatedBy { get; set; }
17 |
18 | public DateTimeOffset Updated { get; set; }
19 |
20 | public string? UpdatedBy { get; set; }
21 |
22 | public byte[] RowVersion { get; set; } = null!;
23 |
24 | public virtual ICollection Users { get; set; } = new List();
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/SchemaVersion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class SchemaVersion
7 | {
8 | public int Id { get; set; }
9 |
10 | public string ScriptName { get; set; } = null!;
11 |
12 | public DateTime Applied { get; set; }
13 | }
14 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Status.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Status
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public int DisplayOrder { get; set; }
15 |
16 | public bool IsActive { get; set; }
17 |
18 | public DateTimeOffset Created { get; set; }
19 |
20 | public string? CreatedBy { get; set; }
21 |
22 | public DateTimeOffset Updated { get; set; }
23 |
24 | public string? UpdatedBy { get; set; }
25 |
26 | public byte[] RowVersion { get; set; } = null!;
27 |
28 | public virtual ICollection Tasks { get; set; } = new List();
29 | }
30 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Task.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Task
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public Guid StatusId { get; set; }
11 |
12 | public Guid? PriorityId { get; set; }
13 |
14 | public string Title { get; set; } = null!;
15 |
16 | public string? Description { get; set; }
17 |
18 | public DateTimeOffset? StartDate { get; set; }
19 |
20 | public DateTimeOffset? DueDate { get; set; }
21 |
22 | public DateTimeOffset? CompleteDate { get; set; }
23 |
24 | public Guid? AssignedId { get; set; }
25 |
26 | public Guid TenantId { get; set; }
27 |
28 | public DateTimeOffset Created { get; set; }
29 |
30 | public string? CreatedBy { get; set; }
31 |
32 | public DateTimeOffset Updated { get; set; }
33 |
34 | public string? UpdatedBy { get; set; }
35 |
36 | public byte[] RowVersion { get; set; } = null!;
37 |
38 | public virtual User? Assigned { get; set; }
39 |
40 | public virtual Priority? Priority { get; set; }
41 |
42 | public virtual Status Status { get; set; } = null!;
43 |
44 | public virtual TaskExtended? TaskExtended { get; set; }
45 |
46 | public virtual Tenant Tenant { get; set; } = null!;
47 | }
48 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/TaskExtended.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class TaskExtended
7 | {
8 | public Guid TaskId { get; set; }
9 |
10 | public string? UserAgent { get; set; }
11 |
12 | public string? Browser { get; set; }
13 |
14 | public string? OperatingSystem { get; set; }
15 |
16 | public DateTimeOffset Created { get; set; }
17 |
18 | public string? CreatedBy { get; set; }
19 |
20 | public DateTimeOffset Updated { get; set; }
21 |
22 | public string? UpdatedBy { get; set; }
23 |
24 | public byte[] RowVersion { get; set; } = null!;
25 |
26 | public virtual Task Task { get; set; } = null!;
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Tenant.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class Tenant
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public bool IsActive { get; set; }
15 |
16 | public DateTimeOffset Created { get; set; }
17 |
18 | public string? CreatedBy { get; set; }
19 |
20 | public DateTimeOffset Updated { get; set; }
21 |
22 | public string? UpdatedBy { get; set; }
23 |
24 | public byte[] RowVersion { get; set; } = null!;
25 |
26 | public virtual ICollection Tasks { get; set; } = new List();
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/Tracker.Scaffold.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | false
8 |
9 |
10 |
11 |
12 | all
13 | runtime; build; native; contentfiles; analyzers; buildtransitive
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/UserLogin.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Tracker.Scaffold;
5 |
6 | public partial class UserLogin
7 | {
8 | public Guid Id { get; set; }
9 |
10 | public string EmailAddress { get; set; } = null!;
11 |
12 | public Guid? UserId { get; set; }
13 |
14 | public string? UserAgent { get; set; }
15 |
16 | public string? Browser { get; set; }
17 |
18 | public string? OperatingSystem { get; set; }
19 |
20 | public string? DeviceFamily { get; set; }
21 |
22 | public string? DeviceBrand { get; set; }
23 |
24 | public string? DeviceModel { get; set; }
25 |
26 | public string? IpAddress { get; set; }
27 |
28 | public bool IsSuccessful { get; set; }
29 |
30 | public string? FailureMessage { get; set; }
31 |
32 | public DateTimeOffset Created { get; set; }
33 |
34 | public string? CreatedBy { get; set; }
35 |
36 | public DateTimeOffset Updated { get; set; }
37 |
38 | public string? UpdatedBy { get; set; }
39 |
40 | public byte[] RowVersion { get; set; } = null!;
41 |
42 | public virtual User? User { get; set; }
43 | }
44 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Scaffold/scaffold.cmd:
--------------------------------------------------------------------------------
1 | dotnet ef dbcontext scaffold "Data Source=(local);Initial Catalog=TrackerGenerator;Integrated Security=True;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer --force
2 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/AuditController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using FluentValidation;
3 | using Tracker.Core.Data;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Web.Controllers
7 | {
8 | public class AuditController : EntityControllerBase
9 | {
10 | public AuditController(TrackerContext dataContext, IMapper mapper, IValidator createValidator, IValidator updateValidator)
11 | : base(dataContext, mapper, createValidator, updateValidator)
12 | {
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/PriorityController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using Tracker.Core.Data;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Web.Controllers
6 | {
7 | public class PriorityController : QueryControllerBase
8 | {
9 | public PriorityController(TrackerContext dataContext, IMapper mapper) : base(dataContext, mapper)
10 | {
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/RoleController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using FluentValidation;
3 | using Tracker.Core.Data;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Web.Controllers
7 | {
8 | public class RoleController : EntityControllerBase
9 | {
10 | public RoleController(TrackerContext dataContext, IMapper mapper, IValidator createValidator, IValidator updateValidator)
11 | : base(dataContext, mapper, createValidator, updateValidator)
12 | {
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/StatusController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using Tracker.Core.Data;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Web.Controllers
6 | {
7 | public class StatusController : QueryControllerBase
8 | {
9 | public StatusController(TrackerContext dataContext, IMapper mapper) : base(dataContext, mapper)
10 | {
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/TaskController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using FluentValidation;
3 | using Tracker.Core.Data;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Web.Controllers
7 | {
8 | public class TaskController : EntityControllerBase
9 | {
10 | public TaskController(TrackerContext dataContext, IMapper mapper, IValidator createValidator, IValidator updateValidator)
11 | : base(dataContext, mapper, createValidator, updateValidator)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/TenantController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using FluentValidation;
3 | using Tracker.Core.Data;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Web.Controllers
7 | {
8 | public class TenantController : EntityControllerBase
9 | {
10 | public TenantController(TrackerContext dataContext, IMapper mapper, IValidator createValidator, IValidator updateValidator)
11 | : base(dataContext, mapper, createValidator, updateValidator)
12 | {
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/UserController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using FluentValidation;
3 | using Tracker.Core.Data;
4 | using Tracker.Core.Domain.Models;
5 |
6 | namespace Tracker.Web.Controllers
7 | {
8 | public class UserController : EntityControllerBase
9 | {
10 | public UserController(TrackerContext dataContext, IMapper mapper, IValidator createValidator, IValidator updateValidator)
11 | : base(dataContext, mapper, createValidator, updateValidator)
12 | {
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Controllers/UserLoginController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using Tracker.Core.Data;
3 | using Tracker.Core.Domain.Models;
4 |
5 | namespace Tracker.Web.Controllers
6 | {
7 | public class UserLoginController : QueryControllerBase
8 | {
9 | public UserLoginController(TrackerContext dataContext, IMapper mapper) : base(dataContext, mapper)
10 | {
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Hosting;
2 | using Microsoft.Extensions.Hosting;
3 |
4 | namespace Tracker.Web
5 | {
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | CreateHostBuilder(args).Build().Run();
11 | }
12 |
13 | public static IHostBuilder CreateHostBuilder(string[] args) =>
14 | Host.CreateDefaultBuilder(args)
15 | .ConfigureWebHostDefaults(webBuilder =>
16 | {
17 | webBuilder.UseStartup();
18 | });
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "profiles": {
4 | "Tracker.Web": {
5 | "commandName": "Project",
6 | "launchBrowser": true,
7 | "launchUrl": "swagger",
8 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
9 | "environmentVariables": {
10 | "ASPNETCORE_ENVIRONMENT": "Development"
11 | }
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/Tracker.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | 984ef0cf-2b22-4fd1-876d-e01499da4c1f
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/sample/Tracker/Tracker.Web/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "ConnectionStrings": {
8 | "Tracker": "Data Source=(local);Initial Catalog=TrackerGenerator;Integrated Security=True;TrustServerCertificate=True"
9 | },
10 | "AllowedHosts": "*"
11 | }
12 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Mapping/IdentityRoleProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using TrackerSchema.Core.Data.Identity.Entities;
4 | using TrackerSchema.Core.Domain.Identity.Models;
5 |
6 | namespace TrackerSchema.Core.Domain.Identity.Mapping
7 | {
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class IdentityRoleProfile
12 | : AutoMapper.Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public IdentityRoleProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Mapping/IdentityUserProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using TrackerSchema.Core.Data.Identity.Entities;
4 | using TrackerSchema.Core.Domain.Identity.Models;
5 |
6 | namespace TrackerSchema.Core.Domain.Identity.Mapping
7 | {
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class IdentityUserProfile
12 | : AutoMapper.Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public IdentityUserProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Models/IdentityUserRoleCreateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace TrackerSchema.Core.Domain.Identity.Models
5 | {
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class IdentityUserRoleCreateModel
10 | {
11 | #region Generated Properties
12 | ///
13 | /// Gets or sets the property value for 'UserId'.
14 | ///
15 | ///
16 | /// The property value for 'UserId'.
17 | ///
18 | public Guid UserId { get; set; }
19 |
20 | ///
21 | /// Gets or sets the property value for 'RoleId'.
22 | ///
23 | ///
24 | /// The property value for 'RoleId'.
25 | ///
26 | public Guid RoleId { get; set; }
27 |
28 | #endregion
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Models/IdentityUserRoleReadModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace TrackerSchema.Core.Domain.Identity.Models
5 | {
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class IdentityUserRoleReadModel
10 | {
11 | #region Generated Properties
12 | ///
13 | /// Gets or sets the property value for 'UserId'.
14 | ///
15 | ///
16 | /// The property value for 'UserId'.
17 | ///
18 | public Guid UserId { get; set; }
19 |
20 | ///
21 | /// Gets or sets the property value for 'RoleId'.
22 | ///
23 | ///
24 | /// The property value for 'RoleId'.
25 | ///
26 | public Guid RoleId { get; set; }
27 |
28 | #endregion
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Models/IdentityUserRoleUpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace TrackerSchema.Core.Domain.Identity.Models
5 | {
6 | ///
7 | /// View Model class
8 | ///
9 | public partial class IdentityUserRoleUpdateModel
10 | {
11 | #region Generated Properties
12 | ///
13 | /// Gets or sets the property value for 'UserId'.
14 | ///
15 | ///
16 | /// The property value for 'UserId'.
17 | ///
18 | public Guid UserId { get; set; }
19 |
20 | ///
21 | /// Gets or sets the property value for 'RoleId'.
22 | ///
23 | ///
24 | /// The property value for 'RoleId'.
25 | ///
26 | public Guid RoleId { get; set; }
27 |
28 | #endregion
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityRoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityRoleCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityRoleCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(256);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityRoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityRoleUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityRoleUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(256);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityUserCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityUserCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityUserCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.EmailAddress).NotEmpty();
20 | RuleFor(p => p.EmailAddress).MaximumLength(256);
21 | RuleFor(p => p.DisplayName).NotEmpty();
22 | RuleFor(p => p.DisplayName).MaximumLength(256);
23 | RuleFor(p => p.CreatedBy).MaximumLength(100);
24 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
25 | #endregion
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityUserRoleCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityUserRoleCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityUserRoleCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | #endregion
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityUserRoleUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityUserRoleUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityUserRoleUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | #endregion
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Identity/Validation/IdentityUserUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Identity.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Identity.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class IdentityUserUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public IdentityUserUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.EmailAddress).NotEmpty();
20 | RuleFor(p => p.EmailAddress).MaximumLength(256);
21 | RuleFor(p => p.DisplayName).NotEmpty();
22 | RuleFor(p => p.DisplayName).MaximumLength(256);
23 | RuleFor(p => p.CreatedBy).MaximumLength(100);
24 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
25 | #endregion
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Mapping/TrackerAuditProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using TrackerSchema.Core.Data.Tracker.Entities;
4 | using TrackerSchema.Core.Domain.Tracker.Models;
5 |
6 | namespace TrackerSchema.Core.Domain.Tracker.Mapping
7 | {
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class TrackerAuditProfile
12 | : AutoMapper.Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TrackerAuditProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Mapping/TrackerStatusProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using TrackerSchema.Core.Data.Tracker.Entities;
4 | using TrackerSchema.Core.Domain.Tracker.Models;
5 |
6 | namespace TrackerSchema.Core.Domain.Tracker.Mapping
7 | {
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class TrackerStatusProfile
12 | : AutoMapper.Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TrackerStatusProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Mapping/TrackerTaskProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AutoMapper;
3 | using TrackerSchema.Core.Data.Tracker.Entities;
4 | using TrackerSchema.Core.Domain.Tracker.Models;
5 |
6 | namespace TrackerSchema.Core.Domain.Tracker.Mapping
7 | {
8 | ///
9 | /// Mapper class for entity .
10 | ///
11 | public partial class TrackerTaskProfile
12 | : AutoMapper.Profile
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public TrackerTaskProfile()
18 | {
19 | CreateMap();
20 |
21 | CreateMap();
22 |
23 | CreateMap();
24 |
25 | CreateMap();
26 |
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerAuditCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerAuditCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerAuditCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Content).NotEmpty();
20 | RuleFor(p => p.Username).NotEmpty();
21 | RuleFor(p => p.Username).MaximumLength(50);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerAuditUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerAuditUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerAuditUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Content).NotEmpty();
20 | RuleFor(p => p.Username).NotEmpty();
21 | RuleFor(p => p.Username).MaximumLength(50);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerPriorityCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerPriorityCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerPriorityCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(100);
21 | RuleFor(p => p.Description).MaximumLength(255);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerPriorityUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerPriorityUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerPriorityUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(100);
21 | RuleFor(p => p.Description).MaximumLength(255);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerStatusCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerStatusCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerStatusCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(100);
21 | RuleFor(p => p.Description).MaximumLength(255);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerStatusUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerStatusUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerStatusUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Name).NotEmpty();
20 | RuleFor(p => p.Name).MaximumLength(100);
21 | RuleFor(p => p.Description).MaximumLength(255);
22 | RuleFor(p => p.CreatedBy).MaximumLength(100);
23 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
24 | #endregion
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerTaskCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerTaskCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerTaskCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Title).NotEmpty();
20 | RuleFor(p => p.Title).MaximumLength(255);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerTaskExtendedCreateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerTaskExtendedCreateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerTaskExtendedCreateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Browser).MaximumLength(256);
20 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerTaskExtendedUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerTaskExtendedUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerTaskExtendedUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Browser).MaximumLength(256);
20 | RuleFor(p => p.OperatingSystem).MaximumLength(256);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/Domain/Tracker/Validation/TrackerTaskUpdateModelValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentValidation;
3 | using TrackerSchema.Core.Domain.Tracker.Models;
4 |
5 | namespace TrackerSchema.Core.Domain.Tracker.Validation
6 | {
7 | ///
8 | /// Validator class for .
9 | ///
10 | public partial class TrackerTaskUpdateModelValidator
11 | : AbstractValidator
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public TrackerTaskUpdateModelValidator()
17 | {
18 | #region Generated Constructor
19 | RuleFor(p => p.Title).NotEmpty();
20 | RuleFor(p => p.Title).MaximumLength(255);
21 | RuleFor(p => p.CreatedBy).MaximumLength(100);
22 | RuleFor(p => p.UpdatedBy).MaximumLength(100);
23 | #endregion
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Core/TrackerSchema.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Database/TrackerSchema.Database.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | PreserveNewest
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sample/TrackerSchema/TrackerSchema.Database/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "TrackerSchema": "Data Source=(local);Initial Catalog=TrackerSchema;Integrated Security=True"
4 | }
5 | }
--------------------------------------------------------------------------------
/sample/create-docker.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=!p@ssword -d postgres:latest
4 | docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=!p@ssword -d mysql:latest
--------------------------------------------------------------------------------
/sample/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 |
5 | postgres:
6 | image: postgres:latest
7 | container_name: postgres
8 | restart: always
9 | environment:
10 | POSTGRES_PASSWORD: "!p@ssword"
11 | ports:
12 | - "5432:5432"
13 |
14 | mysql:
15 | image: mysql:latest
16 | container_name: mysql
17 | command: --default-authentication-plugin=mysql_native_password
18 | restart: always
19 | environment:
20 | MYSQL_ROOT_PASSWORD: "!p@ssword"
21 |
22 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/ICodeGenerator.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Options;
2 |
3 | namespace EntityFrameworkCore.Generator;
4 |
5 | public interface ICodeGenerator
6 | {
7 | bool Generate(GeneratorOptions options);
8 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/IOptionVariable.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator;
2 |
3 | ///
4 | /// Interface for option variables.
5 | ///
6 | public interface IOptionVariable
7 | {
8 | ///
9 | /// Sets variables on the specified VariableDictionary.
10 | ///
11 | /// The variable dictionary.
12 | void Set(VariableDictionary variableDictionary);
13 |
14 | ///
15 | /// Removes variables on the specified VariableDictionary.
16 | ///
17 | /// The variable dictionary.
18 | void Remove(VariableDictionary variableDictionary);
19 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/Cardinality.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
2 |
3 | public enum Cardinality
4 | {
5 | ZeroOrOne,
6 | One,
7 | Many
8 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/EntityContext.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
4 |
5 | [DebuggerDisplay("Class: {ContextClass}, Database: {DatabaseName}")]
6 | public class EntityContext : ModelBase
7 | {
8 | public EntityContext()
9 | {
10 | Entities = [];
11 | }
12 |
13 | public string ContextNamespace { get; set; } = null!;
14 |
15 | public string ContextClass { get; set; } = null!;
16 |
17 | public string? ContextBaseClass { get; set; }
18 |
19 | public string? DatabaseName { get; set; }
20 |
21 | public EntityCollection Entities { get; set; }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/Method.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
4 |
5 | [DebuggerDisplay("Suffix: {NameSuffix}, IsKey: {IsKey}, IsUnique: {IsUnique}")]
6 | public class Method : ModelBase
7 | {
8 | public Method()
9 | {
10 | Properties = [];
11 | }
12 |
13 | public Entity Entity { get; set; } = null!;
14 |
15 | public string? NameSuffix { get; set; }
16 | public string? SourceName { get; set; }
17 |
18 | public bool IsKey { get; set; }
19 | public bool IsUnique { get; set; }
20 | public bool IsIndex { get; set; }
21 |
22 | public PropertyCollection Properties { get; set; }
23 | }
24 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/Model.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
2 |
3 | public class Model : ModelBase, IOptionVariable
4 | {
5 | public Model()
6 | {
7 | Properties = [];
8 | }
9 |
10 | public Entity Entity { get; set; } = null!;
11 |
12 | public ModelType ModelType { get; set; }
13 |
14 | public string ModelNamespace { get; set; } = null!;
15 |
16 | public string ModelClass { get; set; } = null!;
17 |
18 | public string? ModelBaseClass { get; set; }
19 |
20 | public string? ModelAttributes { get; set; }
21 |
22 | public string? ModelHeader { get; internal set; }
23 |
24 |
25 | public string? ValidatorNamespace { get; set; }
26 |
27 | public string? ValidatorClass { get; set; }
28 |
29 | public string? ValidatorBaseClass { get; set; }
30 |
31 |
32 | public PropertyCollection Properties { get; set; }
33 |
34 | void IOptionVariable.Set(VariableDictionary variableDictionary)
35 | {
36 | variableDictionary.Set(VariableConstants.ModelName, ModelClass);
37 | }
38 |
39 | void IOptionVariable.Remove(VariableDictionary variableDictionary)
40 | {
41 | variableDictionary.Remove(VariableConstants.ModelName);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/ModelBase.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
2 |
3 | ///
4 | /// A base class for entity generation models
5 | ///
6 | public class ModelBase
7 | {
8 |
9 | ///
10 | /// Gets or sets a value indicating whether this instance is processed.
11 | ///
12 | ///
13 | /// true if this instance is processed; otherwise, false.
14 | ///
15 | public bool IsProcessed { get; set; }
16 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/ModelType.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
2 |
3 | public enum ModelType
4 | {
5 | Read,
6 | Create,
7 | Update
8 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/Relationship.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Generation;
4 |
5 | [DebuggerDisplay("Primary: {PrimaryEntity}, Property: {PropertyName}, Relationship: {RelationshipName}")]
6 | public class Relationship : ModelBase
7 | {
8 | public Relationship()
9 | {
10 | Properties = [];
11 | PrimaryProperties = [];
12 | }
13 |
14 | public string? RelationshipName { get; set; }
15 |
16 |
17 | public Entity Entity { get; set; } = null!;
18 |
19 | public PropertyCollection Properties { get; set; }
20 |
21 | public string PropertyName { get; set; } = null!;
22 |
23 | public Cardinality Cardinality { get; set; }
24 |
25 |
26 | public Entity PrimaryEntity { get; set; } = null!;
27 |
28 | public PropertyCollection PrimaryProperties { get; set; }
29 |
30 | public string PrimaryPropertyName { get; set; } = null!;
31 |
32 | public Cardinality PrimaryCardinality { get; set; }
33 |
34 |
35 | public bool? CascadeDelete { get; set; }
36 | public bool IsForeignKey { get; set; }
37 | public bool IsMapped { get; set; }
38 |
39 | public bool IsOneToOne => Cardinality != Cardinality.Many && PrimaryCardinality != Cardinality.Many;
40 | }
41 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/CodeRegion.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
2 |
3 | public class CodeRegion
4 | {
5 | public int StartIndex { get; set; }
6 | public int EndIndex { get; set; }
7 | public string RegionName { get; set; } = null!;
8 | public string? ClassName { get; set; }
9 | public string? Content { get; set; }
10 | }
11 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/ParsedContext.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 |
4 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
5 |
6 | [DebuggerDisplay("Context: {ContextClass}")]
7 | public class ParsedContext
8 | {
9 | public ParsedContext()
10 | {
11 | Properties = [];
12 | }
13 |
14 | public string ContextClass { get; set; } = null!;
15 |
16 | public List Properties { get; }
17 | }
18 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/ParsedEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 |
4 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
5 |
6 | [DebuggerDisplay("Table: {TableName}, Entity: {EntityClass}, Mapping: {MappingClass}")]
7 | public class ParsedEntity
8 | {
9 | public ParsedEntity()
10 | {
11 | Properties = [];
12 | Relationships = [];
13 | }
14 |
15 | public string EntityClass { get; set; } = null!;
16 | public string MappingClass { get; set; } = null!;
17 |
18 | public string TableName { get; set; } = null!;
19 | public string? TableSchema { get; set; }
20 |
21 | public List Properties { get; }
22 | public List Relationships { get; }
23 | }
24 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/ParsedEntitySet.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
4 |
5 | [DebuggerDisplay("Entity: {EntityClass}, Property: {ContextProperty}")]
6 | public class ParsedEntitySet
7 | {
8 | public string EntityClass { get; set; } = null!;
9 | public string ContextProperty { get; set; } = null!;
10 | }
11 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/ParsedProperty.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
4 |
5 | [DebuggerDisplay("Column: {ColumnName}, Property: {PropertyName}")]
6 | public class ParsedProperty
7 | {
8 | public string? ColumnName { get; set; }
9 |
10 | public string PropertyName { get; set; } = null!;
11 |
12 | public string? PropertyType { get; set; }
13 |
14 | public bool IsValid()
15 | {
16 | return !string.IsNullOrEmpty(ColumnName)
17 | && !string.IsNullOrEmpty(PropertyName);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Metadata/Parsing/ParsedRelationship.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace EntityFrameworkCore.Generator.Metadata.Parsing;
4 |
5 | [DebuggerDisplay("Name: {RelationshipName}, Property: {PropertyName}, Primary: {PrimaryPropertyName}")]
6 | public class ParsedRelationship
7 | {
8 | public ParsedRelationship()
9 | {
10 | Properties = [];
11 | }
12 |
13 | public string? RelationshipName { get; set; }
14 |
15 | public string? PropertyName { get; set; }
16 |
17 | public List Properties { get; }
18 |
19 | public string? PrimaryPropertyName { get; set; }
20 |
21 |
22 | public bool IsValid()
23 | {
24 | return !string.IsNullOrEmpty(PropertyName)
25 | && !string.IsNullOrEmpty(PrimaryPropertyName)
26 | && Properties.Count > 0;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/ContextClassOptions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | using Microsoft.EntityFrameworkCore;
4 |
5 | namespace EntityFrameworkCore.Generator.Options;
6 |
7 | ///
8 | /// EntityFramework generation options
9 | ///
10 | ///
11 | public class ContextClassOptions : ClassOptionsBase
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public ContextClassOptions(VariableDictionary variables, string? prefix)
17 | : base(variables, AppendPrefix(prefix, "Context"))
18 | {
19 | Namespace = "{Project.Namespace}.Data";
20 | Directory = @"{Project.Directory}\Data";
21 |
22 | Name = "{Database.Name}Context";
23 | BaseClass = "DbContext";
24 | PropertyNaming = ContextNaming.Plural;
25 | }
26 |
27 | ///
28 | /// Gets or sets the property naming strategy for entity data set property.
29 | ///
30 | ///
31 | /// The property naming strategy for entity data set property.
32 | ///
33 | [DefaultValue(ContextNaming.Plural)]
34 | public ContextNaming PropertyNaming { get; set; }
35 | }
36 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/ContextNaming.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 |
3 | namespace EntityFrameworkCore.Generator.Options;
4 |
5 | ///
6 | /// Naming strategies for entity data set property on the generated
7 | ///
8 | public enum ContextNaming
9 | {
10 | ///
11 | /// Preserve the entity name as is
12 | ///
13 | Preserve = 0,
14 |
15 | ///
16 | /// Convert the entity to plural form
17 | ///
18 | Plural = 1,
19 |
20 | ///
21 | /// Add 'DataSet' to the end of the entity name.
22 | ///
23 | Suffix = 2
24 | }
25 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/CreateModelOptions.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Create model file generation options
5 | ///
6 | ///
7 | public class CreateModelOptions : ModelOptionsBase
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public CreateModelOptions(VariableDictionary variables, string? prefix)
13 | : base(variables, AppendPrefix(prefix, "Create"))
14 | {
15 | Name = "{Entity.Name}CreateModel";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/DatabaseProviders.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// The database to generate code for
5 | ///
6 | public enum DatabaseProviders
7 | {
8 | ///
9 | /// The SQL server provider
10 | ///
11 | SqlServer,
12 |
13 | ///
14 | /// The PostgreSQL provider
15 | ///
16 | PostgreSQL,
17 |
18 | ///
19 | /// The MySQL provider
20 | ///
21 | MySQL,
22 |
23 | ///
24 | /// The sqlite provider
25 | ///
26 | Sqlite,
27 |
28 | ///
29 | /// The Oracle provider
30 | ///
31 | Oracle
32 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/EntityNaming.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Entity class naming strategy
5 | ///
6 | public enum EntityNaming
7 | {
8 | ///
9 | /// Use table name as entity name
10 | ///
11 | Preserve = 0,
12 |
13 | ///
14 | /// Use table name in plural form
15 | ///
16 | Plural = 1,
17 |
18 | ///
19 | /// Use table name in singular form
20 | ///
21 | Singular = 2
22 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/MapperClassOptions.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// View model mapper class options
5 | ///
6 | ///
7 | public class MapperClassOptions : ClassOptionsBase
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public MapperClassOptions(VariableDictionary variables, string? prefix)
13 | : base(variables, AppendPrefix(prefix, "Mapper"))
14 | {
15 | Generate = false;
16 | Namespace = "{Project.Namespace}.Domain.Mapping";
17 | Directory = @"{Project.Directory}\Domain\Mapping";
18 |
19 | BaseClass = "AutoMapper.Profile";
20 | Name = "{Entity.Name}Profile";
21 | }
22 |
23 | ///
24 | /// Gets or sets a value indicating whether this option is generated.
25 | ///
26 | ///
27 | /// true to generate; otherwise, false.
28 | ///
29 | public bool Generate { get; set; }
30 | }
31 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/ReadModelOptions.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Read model options
5 | ///
6 | ///
7 | public class ReadModelOptions : ModelOptionsBase
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ReadModelOptions(VariableDictionary variables, string? prefix)
13 | : base(variables, AppendPrefix(prefix, "Read"))
14 | {
15 | Name = "{Entity.Name}ReadModel";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/RelationshipNaming.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Relationship property naming strategy
5 | ///
6 | public enum RelationshipNaming
7 | {
8 | ///
9 | /// Preserve property name as the entity name
10 | ///
11 | Preserve = 0,
12 |
13 | ///
14 | /// Convert the property name to the entity plural name
15 | ///
16 | Plural = 1,
17 |
18 | ///
19 | /// Add 'List' to the end of the entity name.
20 | ///
21 | Suffix = 2
22 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/RowVersionMapping.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// How row versions should be mapped
5 | ///
6 | public enum RowVersionMapping
7 | {
8 | ///
9 | /// Map as byte array, default
10 | ///
11 | ByteArray = 0,
12 | ///
13 | /// Map as a long
14 | ///
15 | Long = 1,
16 | ///
17 | /// Map as a ulong
18 | ///
19 | ULong = 2,
20 | }
21 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/ScriptOptions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace EntityFrameworkCore.Generator.Options;
4 |
5 | public class ScriptOptions : OptionsBase
6 | {
7 | public ScriptOptions(VariableDictionary variables, string? prefix)
8 | : base(variables, AppendPrefix(prefix, "Script"))
9 | {
10 | Context = [];
11 | Entity = [];
12 | Model = [];
13 | }
14 |
15 | ///
16 | /// Gets or sets the list context script templates.
17 | ///
18 | /// The list context script templates.
19 | public List Context { get; }
20 |
21 | ///
22 | /// Gets or sets the list entity script templates.
23 | ///
24 | /// The list entity script templates.
25 | public List Entity { get; }
26 |
27 | ///
28 | /// Gets or sets the list model script templates.
29 | ///
30 | /// The list model script templates.
31 | public List Model { get; }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/SelectionOptions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace EntityFrameworkCore.Generator.Options;
4 |
5 | ///
6 | /// Selection options
7 | ///
8 | public class SelectionOptions : OptionsBase
9 | {
10 | ///
11 | /// Initializes a new instance of the class.
12 | ///
13 | public SelectionOptions(VariableDictionary variables, string? prefix)
14 | : base(variables, prefix)
15 | {
16 | Entities = [];
17 | Properties = [];
18 | }
19 |
20 | ///
21 | /// Gets or sets a list of regular expression of entities to select.
22 | ///
23 | ///
24 | /// The list of regular expression of entities to select.
25 | ///
26 | public List Entities { get; }
27 |
28 | ///
29 | /// Gets or sets a list of regular expression of properties to select.
30 | ///
31 | ///
32 | /// The list of regular expression of properties to select.
33 | ///
34 | public List Properties { get; }
35 | }
36 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/TableNaming.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Table naming hint for how database tables are named.
5 | ///
6 | public enum TableNaming
7 | {
8 | ///
9 | /// Mix of Plural and Singular
10 | ///
11 | Mixed = 0,
12 |
13 | ///
14 | /// Tables are named in plural form
15 | ///
16 | Plural = 1,
17 |
18 | ///
19 | /// Tables are named in singular form
20 | ///
21 | Singular = 2
22 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/UpdateModelOptions.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Update model options
5 | ///
6 | ///
7 | public class UpdateModelOptions : ModelOptionsBase
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public UpdateModelOptions(VariableDictionary variables, string? prefix)
13 | : base(variables, AppendPrefix(prefix, "Update"))
14 | {
15 | Name = "{Entity.Name}UpdateModel";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Options/ValidatorClassOptions.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Options;
2 |
3 | ///
4 | /// Validator class options
5 | ///
6 | ///
7 | public class ValidatorClassOptions : ClassOptionsBase
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ValidatorClassOptions(VariableDictionary variables, string? prefix)
13 | : base(variables, AppendPrefix(prefix, "Validator"))
14 | {
15 | Generate = false;
16 | Namespace = "{Project.Namespace}.Domain.Validation";
17 | Directory = @"{Project.Directory}\Domain\Validation";
18 |
19 | BaseClass = "FluentValidation.AbstractValidator<{Model.Name}>";
20 | Name = "{Model.Name}Validator";
21 | }
22 | ///
23 | /// Gets or sets a value indicating whether this option is generated.
24 | ///
25 | ///
26 | /// true to generate; otherwise, false.
27 | ///
28 | public bool Generate { get; set; }
29 | }
30 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Parsing/RegionParser.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using EntityFrameworkCore.Generator.Metadata.Parsing;
3 | using Microsoft.CodeAnalysis.CSharp;
4 | using Microsoft.CodeAnalysis.CSharp.Syntax;
5 |
6 | namespace EntityFrameworkCore.Generator.Parsing;
7 |
8 | public static class RegionParser
9 | {
10 | public static List ParseRegions(string code)
11 | {
12 | var syntaxTree = CSharpSyntaxTree.ParseText(code);
13 | var root = (CompilationUnitSyntax)syntaxTree.GetRoot();
14 |
15 | var visitor = new RegionVisitor();
16 | visitor.Visit(root);
17 |
18 | var regions = visitor.Regions;
19 |
20 | // extract content using start and end indexes
21 | foreach (var region in regions)
22 | {
23 | var start = region.StartIndex;
24 | var end = region.EndIndex;
25 | var length = end - start;
26 |
27 | region.Content = code.Substring(start, length);
28 | }
29 |
30 | return regions;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/ContextScriptTemplate.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 |
4 | using Microsoft.Extensions.Logging;
5 |
6 | namespace EntityFrameworkCore.Generator.Scripts;
7 |
8 | public class ContextScriptTemplate : ScriptTemplateBase
9 | {
10 | private EntityContext _entityContext = null!;
11 |
12 | public ContextScriptTemplate(ILoggerFactory loggerFactory, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
13 | : base(loggerFactory, generatorOptions, templateOptions)
14 | {
15 | }
16 |
17 | public void RunScript(EntityContext entityContext)
18 | {
19 | ArgumentNullException.ThrowIfNull(entityContext);
20 |
21 | _entityContext = entityContext;
22 |
23 | WriteCode();
24 | }
25 |
26 | protected override ContextScriptVariables CreateVariables()
27 | {
28 | return new ContextScriptVariables(_entityContext, GeneratorOptions, TemplateOptions);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/ContextScriptVariables.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 |
4 | namespace EntityFrameworkCore.Generator.Scripts;
5 |
6 | public class ContextScriptVariables : ScriptVariablesBase
7 | {
8 | public ContextScriptVariables(EntityContext entityContext, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
9 | : base(generatorOptions, templateOptions)
10 | {
11 | EntityContext = entityContext ?? throw new ArgumentNullException(nameof(entityContext));
12 | }
13 |
14 | public EntityContext EntityContext { get; }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/EntityScriptTemplate.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace EntityFrameworkCore.Generator.Scripts;
6 |
7 | public class EntityScriptTemplate : ScriptTemplateBase
8 | {
9 | private Entity _entity = null!;
10 |
11 | public EntityScriptTemplate(ILoggerFactory loggerFactory, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
12 | : base(loggerFactory, generatorOptions, templateOptions)
13 | {
14 | }
15 |
16 | public void RunScript(Entity entity)
17 | {
18 | ArgumentNullException.ThrowIfNull(entity);
19 |
20 | _entity = entity;
21 |
22 | WriteCode();
23 | }
24 |
25 | protected override EntityScriptVariables CreateVariables()
26 | {
27 | return new EntityScriptVariables(_entity, GeneratorOptions, TemplateOptions);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/EntityScriptVariables.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 |
4 | namespace EntityFrameworkCore.Generator.Scripts;
5 |
6 | public class EntityScriptVariables : ScriptVariablesBase
7 | {
8 | public EntityScriptVariables(Entity entity, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
9 | : base(generatorOptions, templateOptions)
10 | {
11 | Entity = entity ?? throw new ArgumentNullException(nameof(entity));
12 | }
13 |
14 | public Entity Entity { get; }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/ModelScriptTemplate.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace EntityFrameworkCore.Generator.Scripts;
6 |
7 | public class ModelScriptTemplate : ScriptTemplateBase
8 | {
9 | private Model _model = null!;
10 |
11 | public ModelScriptTemplate(ILoggerFactory loggerFactory, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
12 | : base(loggerFactory, generatorOptions, templateOptions)
13 | {
14 | }
15 |
16 | public void RunScript(Model model)
17 | {
18 | ArgumentNullException.ThrowIfNull(model);
19 |
20 | _model = model;
21 |
22 | WriteCode();
23 | }
24 |
25 | protected override ModelScriptVariables CreateVariables()
26 | {
27 | return new ModelScriptVariables(_model, GeneratorOptions, TemplateOptions);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/ModelScriptVariables.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Metadata.Generation;
2 | using EntityFrameworkCore.Generator.Options;
3 |
4 | namespace EntityFrameworkCore.Generator.Scripts;
5 |
6 | public class ModelScriptVariables : ScriptVariablesBase
7 | {
8 | public ModelScriptVariables(Model model, GeneratorOptions generatorOptions, TemplateOptions templateOptions)
9 | : base(generatorOptions, templateOptions)
10 | {
11 | Model = model ?? throw new ArgumentNullException(nameof(model));
12 | }
13 |
14 | public Model Model { get; }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Scripts/ScriptVariablesBase.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkCore.Generator.Options;
2 | using Microsoft.EntityFrameworkCore.Infrastructure;
3 |
4 | namespace EntityFrameworkCore.Generator.Scripts;
5 |
6 | public abstract class ScriptVariablesBase
7 | {
8 | protected ScriptVariablesBase(GeneratorOptions generatorOptions, TemplateOptions templateOptions)
9 | {
10 | GeneratorOptions = generatorOptions ?? throw new ArgumentNullException(nameof(generatorOptions));
11 | TemplateOptions = templateOptions ?? throw new ArgumentNullException(nameof(templateOptions));
12 | CodeBuilder = new IndentedStringBuilder();
13 | }
14 |
15 | public TemplateOptions TemplateOptions { get; }
16 |
17 | public GeneratorOptions GeneratorOptions { get; }
18 |
19 | public IndentedStringBuilder CodeBuilder { get; }
20 | }
21 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ContextClass.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | using EntityFrameworkCore.Generator.Options;
4 |
5 | using Microsoft.EntityFrameworkCore;
6 |
7 | namespace EntityFrameworkCore.Generator.Serialization;
8 |
9 | ///
10 | /// EntityFramework generation options
11 | ///
12 | ///
13 | public class ContextClass : ClassBase
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public ContextClass()
19 | {
20 | Namespace = "{Project.Namespace}.Data";
21 | Directory = @"{Project.Directory}\Data";
22 |
23 | Name = "{Database.Name}Context";
24 | BaseClass = "DbContext";
25 | PropertyNaming = ContextNaming.Plural;
26 | }
27 |
28 | ///
29 | /// Gets or sets the property naming strategy for entity data set property.
30 | ///
31 | ///
32 | /// The property naming strategy for entity data set property.
33 | ///
34 | [DefaultValue(ContextNaming.Plural)]
35 | public ContextNaming PropertyNaming { get; set; }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/CreateModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Create model file generation options
5 | ///
6 | public class CreateModel : ModelBase
7 | {
8 | ///
9 | /// Initializes a new instance of the class.
10 | ///
11 | public CreateModel()
12 | {
13 | Name = "{Entity.Name}CreateModel";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/DataModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Data class options
5 | ///
6 | public class DataModel
7 | {
8 | ///
9 | /// Gets or sets the data context generation options.
10 | ///
11 | ///
12 | /// The data context options
13 | ///
14 | public ContextClass Context { get; set; } = new();
15 |
16 |
17 | ///
18 | /// Gets or sets the entity class generation options.
19 | ///
20 | ///
21 | /// The entity class generation options.
22 | ///
23 | public EntityClass Entity { get; set; } = new();
24 |
25 | ///
26 | /// Gets or sets the mapping class generation options.
27 | ///
28 | ///
29 | /// The mapping class generation options.
30 | ///
31 | public MappingClass Mapping { get; set; } = new();
32 |
33 | ///
34 | /// Gets or sets the query extension options.
35 | ///
36 | ///
37 | /// The query extension options.
38 | ///
39 | public QueryExtension Query { get; set; } = new();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/DatabaseMatchModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Represents a model that specifies patterns for tables and columns to be ignored during processing.
5 | ///
6 | public class DatabaseMatchModel
7 | {
8 | ///
9 | /// Gets or sets a list of regular expression of tables to ignore.
10 | ///
11 | ///
12 | /// The list of regular expression of tables to ignore.
13 | ///
14 | public List? Tables { get; set; }
15 |
16 | ///
17 | /// Gets or sets a list of regular expression of columns to ignore.
18 | ///
19 | ///
20 | /// The list of regular expression of columns to ignore.
21 | ///
22 | public List? Columns { get; set; }
23 | }
24 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/GeneratorModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Generator Options
5 | ///
6 | public class GeneratorModel
7 | {
8 | ///
9 | /// Gets or sets the project .
10 | ///
11 | ///
12 | /// The project level .
13 | ///
14 | public ProjectModel Project { get; set; } = new();
15 |
16 | ///
17 | /// Gets or sets the for reverse engineer the database.
18 | ///
19 | ///
20 | /// The database.
21 | ///
22 | public DatabaseModel Database { get; set; } = new();
23 |
24 | ///
25 | /// Gets or sets the EntityFramework configuration .
26 | ///
27 | ///
28 | /// The data.
29 | ///
30 | public DataModel Data { get; set; } = new();
31 |
32 | ///
33 | /// Gets or sets the domain view model .
34 | ///
35 | ///
36 | /// The model.
37 | ///
38 | public ViewModel Model { get; set; } = new();
39 |
40 | ///
41 | /// Gets or sets the script template .
42 | ///
43 | ///
44 | /// The script template .
45 | ///
46 | public ScriptModel? Script { get; set; }
47 | }
48 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/MapperClass.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// View model mapper class options
5 | ///
6 | public class MapperClass : ClassBase
7 | {
8 | ///
9 | /// Initializes a new instance of the class.
10 | ///
11 | public MapperClass()
12 | {
13 | Generate = false;
14 | Namespace = "{Project.Namespace}.Domain.Mapping";
15 | Directory = @"{Project.Directory}\Domain\Mapping";
16 |
17 | BaseClass = "AutoMapper.Profile";
18 | Name = "{Entity.Name}Profile";
19 | }
20 |
21 | ///
22 | /// Gets or sets a value indicating whether this option is generated.
23 | ///
24 | ///
25 | /// true to generate; otherwise, false.
26 | ///
27 | public bool Generate { get; set; }
28 | }
29 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/MatchModel.cs:
--------------------------------------------------------------------------------
1 | using YamlDotNet.Serialization;
2 |
3 | namespace EntityFrameworkCore.Generator.Serialization;
4 |
5 | ///
6 | /// Match options
7 | ///
8 | public class MatchModel
9 | {
10 | ///
11 | /// Gets or sets the exact string match option.
12 | ///
13 | ///
14 | /// The exact string match option.
15 | ///
16 | [YamlMember(Alias = "exact")]
17 | public string? Exact { get; set; }
18 |
19 | ///
20 | /// Gets or sets the regular expression pattern match option.
21 | ///
22 | ///
23 | /// The regular expression pattern match option.
24 | ///
25 | [YamlMember(Alias = "regex")]
26 | public string? Expression { get; set; }
27 |
28 | ///
29 | /// Performs an implicit conversion from to .
30 | ///
31 | /// The value to use for conversion.
32 | ///
33 | /// The result of the conversion.
34 | ///
35 | public static implicit operator MatchModel(string value)
36 | {
37 | return new MatchModel
38 | {
39 | Expression = value
40 | };
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ModelBase.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Base class for the Model generation
5 | ///
6 | public abstract class ModelBase : ClassBase
7 | {
8 | ///
9 | /// Initializes a new instance of the class.
10 | ///
11 | protected ModelBase()
12 | {
13 | // null so shared option is used
14 | Namespace = null;
15 | Directory = null;
16 |
17 | Generate = false;
18 | }
19 |
20 | ///
21 | /// Gets or sets a value indicating whether this option is generated.
22 | ///
23 | ///
24 | /// true to generate; otherwise, false.
25 | ///
26 | public bool Generate { get; set; }
27 |
28 | ///
29 | /// Gets or sets the include selection options.
30 | ///
31 | ///
32 | /// The include selection options.
33 | ///
34 | public SelectionModel? Include { get; set; }
35 |
36 | ///
37 | /// Gets or sets the exclude selection options.
38 | ///
39 | ///
40 | /// The exclude selection options.
41 | ///
42 | public SelectionModel? Exclude { get; set; }
43 | }
44 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ProjectModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace EntityFrameworkCore.Generator.Serialization;
4 |
5 | ///
6 | /// Project options
7 | ///
8 | public class ProjectModel
9 | {
10 | ///
11 | /// Gets or sets the project root namespace.
12 | ///
13 | ///
14 | /// The project root namespace.
15 | ///
16 | public string? Namespace { get; set; }
17 |
18 | ///
19 | /// Gets or sets the project directory.
20 | ///
21 | ///
22 | /// The project directory.
23 | ///
24 | public string? Directory { get; set; }
25 |
26 |
27 | ///
28 | /// Gets or sets if the output should support nullable reference types.
29 | ///
30 | ///
31 | /// If the output should support nullable reference types.
32 | ///
33 | [DefaultValue(false)]
34 | public bool Nullable { get; set; }
35 |
36 | ///
37 | /// Gets or sets a value indicating whether to use file-scoped namespace.
38 | ///
39 | ///
40 | /// true to use file-coped namespace; otherwise, false.
41 | ///
42 | [DefaultValue(false)]
43 | public bool FileScopedNamespace { get; set; }
44 | }
45 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ReadModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Read model options
5 | ///
6 | public class ReadModel : ModelBase
7 | {
8 | ///
9 | /// Initializes a new instance of the class.
10 | ///
11 | public ReadModel()
12 | {
13 | Name = "{Entity.Name}ReadModel";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ScriptModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace EntityFrameworkCore.Generator.Serialization;
4 |
5 | ///
6 | /// Script options
7 | ///
8 | public class ScriptModel
9 | {
10 | ///
11 | /// Gets or sets the list context script templates.
12 | ///
13 | /// The list context script templates.
14 | public List? Context { get; set; }
15 |
16 | ///
17 | /// Gets or sets the list entity script templates.
18 | ///
19 | /// The list entity script templates.
20 | public List? Entity { get; set; }
21 |
22 | ///
23 | /// Gets or sets the list model script templates.
24 | ///
25 | /// The list model script templates.
26 | public List? Model { get; set; }
27 | }
28 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/SelectionModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace EntityFrameworkCore.Generator.Serialization;
4 |
5 | ///
6 | /// Selection options
7 | ///
8 | public class SelectionModel
9 | {
10 | ///
11 | /// Gets or sets a list of regular expression of entities to select.
12 | ///
13 | ///
14 | /// The list of regular expression of entities to select.
15 | ///
16 | public List? Entities { get; set; }
17 |
18 | ///
19 | /// Gets or sets a list of regular expression of properties to select.
20 | ///
21 | ///
22 | /// The list of regular expression of properties to select.
23 | ///
24 | public List? Properties { get; set; }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/UpdateModel.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator.Serialization;
2 |
3 | ///
4 | /// Update model options
5 | ///
6 | public class UpdateModel : ModelBase
7 | {
8 | ///
9 | /// Initializes a new instance of the class.
10 | ///
11 | public UpdateModel()
12 | {
13 | Name = "{Entity.Name}UpdateModel";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/Serialization/ValidatorClass.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace EntityFrameworkCore.Generator.Serialization;
4 |
5 | ///
6 | /// Validator class options
7 | ///
8 | public class ValidatorClass : ClassBase
9 | {
10 | ///
11 | /// Initializes a new instance of the class.
12 | ///
13 | public ValidatorClass()
14 | {
15 | Generate = false;
16 | Namespace = "{Project.Namespace}.Domain.Validation";
17 | Directory = @"{Project.Directory}\Domain\Validation";
18 |
19 | BaseClass = "FluentValidation.AbstractValidator<{Model.Name}>";
20 | Name = "{Model.Name}Validator";
21 | }
22 | ///
23 | /// Gets or sets a value indicating whether this option is generated.
24 | ///
25 | ///
26 | /// true to generate; otherwise, false.
27 | ///
28 | [DefaultValue(false)]
29 | public bool Generate { get; set; }
30 | }
31 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator.Core/VariableConstants.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkCore.Generator;
2 |
3 | public static class VariableConstants
4 | {
5 | public const string TableSchema = "Table.Schema";
6 | public const string TableName = "Table.Name";
7 | public const string EntityName = "Entity.Name";
8 | public const string ModelName = "Model.Name";
9 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator/CommandBase.cs:
--------------------------------------------------------------------------------
1 | using McMaster.Extensions.CommandLineUtils;
2 |
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace EntityFrameworkCore.Generator;
6 |
7 | [HelpOption("--help")]
8 | public abstract class CommandBase
9 | {
10 | protected CommandBase(ILoggerFactory logger, IConsole console)
11 | {
12 | Logger = logger.CreateLogger(GetType());
13 | Console = console;
14 | }
15 |
16 | protected ILogger Logger { get; }
17 |
18 | protected IConsole Console { get; }
19 |
20 | protected abstract int OnExecute(CommandLineApplication application);
21 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator/EntityFrameworkCore.Generator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 | efg
6 | true
7 | 1591,EF1001
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator/OptionsCommandBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using McMaster.Extensions.CommandLineUtils;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace EntityFrameworkCore.Generator;
6 |
7 | public abstract class OptionsCommandBase : CommandBase
8 | {
9 | protected OptionsCommandBase(ILoggerFactory logger, IConsole console, IConfigurationSerializer serializer)
10 | : base(logger, console)
11 | {
12 | Serializer = serializer;
13 | }
14 |
15 | protected IConfigurationSerializer Serializer { get; }
16 |
17 | [Option("-d ", Description = "The root working directory")]
18 | public string WorkingDirectory { get; set; } = Environment.CurrentDirectory;
19 |
20 | [Option("-f ", Description = "The options file name")]
21 | public string OptionsFile { get; set; } = ConfigurationSerializer.OptionsFileName;
22 | }
--------------------------------------------------------------------------------
/src/EntityFrameworkCore.Generator/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "EntityFrameworkCore.Generator": {
4 | "commandName": "Project",
5 | "commandLineArgs": "generate",
6 | "workingDirectory": "..\\..\\sample\\Tracker\\Tracker.Core"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/EntityFrameworkCore.Generator.Core.Tests/DatabaseCollection.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace FluentCommand.SqlServer.Tests;
4 |
5 | [CollectionDefinition(DatabaseCollection.CollectionName)]
6 | public class DatabaseCollection : ICollectionFixture
7 | {
8 | public const string CollectionName = "DatabaseCollection";
9 | }
--------------------------------------------------------------------------------
/test/EntityFrameworkCore.Generator.Core.Tests/DatabaseTestBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xunit;
4 | using Xunit.Abstractions;
5 |
6 | namespace FluentCommand.SqlServer.Tests;
7 |
8 | [Collection(DatabaseCollection.CollectionName)]
9 | public abstract class DatabaseTestBase : IDisposable
10 | {
11 | protected DatabaseTestBase(ITestOutputHelper output, DatabaseFixture databaseFixture)
12 | {
13 | Output = output;
14 | Database = databaseFixture;
15 | }
16 |
17 |
18 | public ITestOutputHelper Output { get; }
19 |
20 | public DatabaseFixture Database { get; }
21 |
22 | public void Dispose()
23 | {
24 | Database?.Report(Output);
25 | }
26 | }
--------------------------------------------------------------------------------
/test/EntityFrameworkCore.Generator.Core.Tests/Scripts/Script003.Tracker.User.sql:
--------------------------------------------------------------------------------
1 | IF NOT EXISTS
2 | (SELECT name
3 | FROM master.sys.sql_logins
4 | WHERE name = 'testuser')
5 | BEGIN
6 | CREATE LOGIN [testuser] WITH PASSWORD = N'rglna{adQP123456';
7 | END
8 | -- check our db
9 | IF NOT EXISTS
10 | (SELECT name
11 | FROM sys.database_principals
12 | WHERE name = 'testuser')
13 | BEGIN
14 | CREATE USER [testuser] FOR LOGIN [testuser] WITH DEFAULT_SCHEMA = dbo
15 | END
16 | exec sp_addrolemember db_datareader, 'testuser'
17 | exec sp_addrolemember db_datawriter, 'testuser'
18 |
--------------------------------------------------------------------------------
/test/EntityFrameworkCore.Generator.Core.Tests/appsettings.github.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "Tracker": "Server=localhost;Database=TrackerGithub;User Id=SA;Password=!P@ssw0rd;TrustServerCertificate=True;"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/EntityFrameworkCore.Generator.Core.Tests/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "Tracker": "Data Source=(local);Initial Catalog=TrackerGeneratorTest;Integrated Security=True;TrustServerCertificate=True"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------