dotnet-starter-kit
dotnet-starter-kit copied to clipboard
One model - two table !?
I Have two module in two project with two Database shema like Todos Module :
- Setting Module with Dimension model => to save some pickup value ...., then other project can use it.
- Elearing Module with Quiz model
- Quiz and Dimension have relationship one => Many
When do migration, EF created two Dimensions table: One for Quiz Quiz Project, one for Setting Project !!
How to work around this issue , because I only want all porjects use same table Dimension in Setting Module ?
Belows are codes ...
` namespace FSH.Starter.WebApi.Elearning.Domain;
public class Quiz : AuditableEntity, IAggregateRoot { public int Order { get; private set; } public string Code { get; private set; } public string Name { get; private set; } public Guid QuizTypeId { get; private set; } public virtual Dimension QuizType { get; private set; } = default!; public Guid QuizTopicId { get; private set; } public virtual Dimension QuizTopic { get; private set; } = default!; public Guid QuizModeId { get; private set; } public virtual Dimension QuizMode { get; private set; } = default!; }
namespace FSH.Starter.WebApi.Setting.Domain;
public class Dimension : AuditableEntity, IAggregateRoot { public int Order { get; private set; } public string Code { get; private set; } public string Name { get; private set; } public string? Description { get; private set; } } ` ' namespace FSH.Framework.Infrastructure.Persistence; public static class SchemaNames { public const string Todo = "todo"; public const string Catalog = "catalog"; public const string Tenant = "tenant"; public const string Setting = "setting"; public const string Elearning = "elearning"; }
'