diff --git a/src/Lumina.DataAccess/Common/Configuration/GenreConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/GenreConfiguration.cs new file mode 100644 index 00000000..707ba145 --- /dev/null +++ b/src/Lumina.DataAccess/Common/Configuration/GenreConfiguration.cs @@ -0,0 +1,26 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Models.Common; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +#endregion + +namespace Lumina.DataAccess.Common.Configuration; + +/// +/// Configures the entity mapping for the entity. +/// +public class GenreConfiguration : IEntityTypeConfiguration +{ + #region ===================================================================== METHODS =================================================================================== + /// + /// Configures the entity. + /// + /// The builder to be used to configure the entity. + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("Genres"); + builder.HasKey(genre => genre.Name); + builder.Property(genre => genre.Name).IsRequired().HasMaxLength(50); + } + #endregion +} \ No newline at end of file diff --git a/src/Lumina.DataAccess/Common/Configuration/TagConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/TagConfiguration.cs new file mode 100644 index 00000000..96c9606c --- /dev/null +++ b/src/Lumina.DataAccess/Common/Configuration/TagConfiguration.cs @@ -0,0 +1,26 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Models.Common; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +#endregion + +namespace Lumina.DataAccess.Common.Configuration; + +/// +/// Configures the entity mapping for the entity. +/// +public class TagConfiguration : IEntityTypeConfiguration +{ + #region ===================================================================== METHODS =================================================================================== + /// + /// Configures the entity. + /// + /// The builder to be used to configure the entity. + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("Tags"); + builder.HasKey(tag => tag.Name); + builder.Property(tag => tag.Name).IsRequired().HasMaxLength(50); + } + #endregion +} \ No newline at end of file diff --git a/src/Lumina.DataAccess/Common/DependencyInjection/DataAccessLayerServices.cs b/src/Lumina.DataAccess/Common/DependencyInjection/DataAccessLayerServices.cs index eb2d50e7..6aef7127 100644 --- a/src/Lumina.DataAccess/Common/DependencyInjection/DataAccessLayerServices.cs +++ b/src/Lumina.DataAccess/Common/DependencyInjection/DataAccessLayerServices.cs @@ -55,4 +55,4 @@ public static class DataAccessLayerServices } } #endregion -} +} \ No newline at end of file