Backend Services Split into separate projects for reference from other front ends

This commit is contained in:
daniel-c-harvey
2025-09-07 12:56:52 -04:00
parent a5b7ab041e
commit b16bcfc6cd
47 changed files with 153 additions and 114 deletions
@@ -0,0 +1,49 @@
using DeepDrftModels.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace DeepDrftWeb.Services.Data.Configurations;
public class TrackConfiguration : IEntityTypeConfiguration<TrackEntity>
{
public void Configure(EntityTypeBuilder<TrackEntity> builder)
{
builder.ToTable("track");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id)
.HasColumnName("id")
.IsRequired();
builder.Property(x => x.EntryKey)
.HasColumnName("entry_key")
.IsRequired()
.HasMaxLength(100);
builder.Property(x => x.TrackName)
.HasColumnName("track_name")
.IsRequired()
.HasMaxLength(200);
builder.Property(x => x.Artist)
.HasColumnName("artist")
.IsRequired()
.HasMaxLength(200);
builder.Property(x => x.Album)
.HasColumnName("album")
.HasMaxLength(200);
builder.Property(x => x.Genre)
.HasColumnName("genre")
.HasMaxLength(100);
builder.Property(x => x.ReleaseDate)
.HasColumnName("release_date");
builder.Property(x => x.ImagePath)
.HasColumnName("image_path")
.HasMaxLength(500);
}
}
@@ -0,0 +1,21 @@
using DeepDrftModels.Entities;
using DeepDrftWeb.Services.Data.Configurations;
using Microsoft.EntityFrameworkCore;
namespace DeepDrftWeb.Services.Data;
public class DeepDrftContext : DbContext
{
public DeepDrftContext(DbContextOptions<DeepDrftContext> options) : base(options)
{
}
public DbSet<TrackEntity> Tracks { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfiguration(new TrackConfiguration());
}
}