Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2291 review ef core layer and extract internal db models for rdms #2292

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

pournasserian
Copy link
Contributor

No description provided.

Introduce FluentCMS.Repositories.EFCore.DbModels namespace with
new classes and interfaces. Added entities include ApiToken,
AuditableEntity, Block, Content, ContentType, ContentTypeField,
Entity, File, Folder, GlobalSettings, FileUploadConfig, Layout,
Page, Permission, Plugin, PluginContent, PluginDefinition,
PluginDefinitionType, Policy, Role, RoleTypes, Settings, Site,
and SiteAssociatedEntity. These additions provide a foundation
for managing content, permissions, and settings within the CMS.
Refactored various classes to use ICollection instead of List or Dictionary for properties, enhancing flexibility and consistency. Added navigation properties and foreign keys to improve data relationships. Introduced new classes to represent specific data structures and settings.
@pournasserian pournasserian linked an issue Nov 21, 2024 that may be closed by this pull request
@pournasserian pournasserian self-assigned this Nov 21, 2024
@pournasserian pournasserian added the enhancement New feature or request label Nov 21, 2024
@pournasserian pournasserian added this to the MVP milestone Nov 21, 2024
@pournasserian pournasserian marked this pull request as draft November 21, 2024 22:57
Removed obsolete classes and interfaces including ApiToken, AuditableEntity, Block, Content, and others. Updated FluentCmsDbContext to use new DbSet properties for corresponding models. Modified MappingProfile to introduce new mappings for the new models and removed old mappings. Added new using directives and global usings. Introduced new model classes with appropriate attributes, properties, and relationships. Implemented standard interfaces for entity properties.
Updated ApiTokenModel, ApiTokenPolicyModel, and GlobalSettingsModel to inherit from AuditableEntityModel and EntityModel. Modified EFCoreServiceExtensions to comment out IUserRepository and IUserRoleRepository services. Refactored ApiTokenRepository, AuditableEntityRepository, and other repository classes to use IMapper for entity mapping. Introduced new interfaces IAuditableEntityRepository, IEntityRepository, and ISiteAssociatedRepository. Commented out UserRepository and UserRoleRepository classes. Updated _GlobalUsings.cs to include global usings for FluentCMS.Repositories.EFCore.DbModels and AutoMapper.
Reintroduced previously commented-out code in FluentCmsDbContext.cs, including configurations for ApiTokenModel, ApiTokenPolicyModel, SettingsModel, and new SettingValuesModel with relationships and cascade delete behaviors.

Removed AutoMapper import in MappingProfile.cs and updated mappings for AuditableEntityModel to ignore CreatedBy and CreatedAt fields.

Modified return statements in EntityRepository.cs methods to map database entities back to domain entities before returning.

Refactored GlobalSettingsRepository.cs to use AutoMapper for mapping between GlobalSettings and GlobalSettingsModel, and updated the Update method to handle both creation and updating of settings.

Refactored SettingsRepository.cs to use SettingsModel and SettingValuesModel, removing AutoMapper import and ensuring proper mapping and saving of changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review EF Core layer and extract internal DB models for RDMS
1 participant