Replaced all usage of the Catalog entity with VwmyCatalog across application, domain, and infrastructure layers. Updated AutoMapper profiles, repository interfaces, and service logic to use VwmyCatalog. Removed the obsolete Catalog entity and related mapping profiles. Moved VwmyCatalog to the Domain.Entities namespace and cleaned up project structure. This change simplifies the domain model and eliminates redundant entity definitions.
53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using DbFirst.Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace DbFirst.Infrastructure;
|
|
|
|
public partial class ApplicationDbContext : DbContext
|
|
{
|
|
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
public virtual DbSet<VwmyCatalog> VwmyCatalogs { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<VwmyCatalog>(entity =>
|
|
{
|
|
entity.HasKey(e => e.Guid);
|
|
|
|
entity.ToView("VWMY_CATALOG");
|
|
|
|
entity.Property(e => e.Guid).HasColumnName("GUID");
|
|
entity.Property(e => e.AddedWho)
|
|
.HasMaxLength(30)
|
|
.IsUnicode(false)
|
|
.HasColumnName("ADDED_WHO");
|
|
entity.Property(e => e.AddedWhen)
|
|
.HasColumnType("datetime")
|
|
.HasColumnName("ADDED_WHEN");
|
|
entity.Property(e => e.CatString)
|
|
.HasMaxLength(900)
|
|
.IsUnicode(false)
|
|
.HasColumnName("CAT_STRING");
|
|
entity.Property(e => e.CatTitle)
|
|
.HasMaxLength(100)
|
|
.IsUnicode(false)
|
|
.HasColumnName("CAT_TITLE");
|
|
entity.Property(e => e.ChangedWhen)
|
|
.HasColumnType("datetime")
|
|
.HasColumnName("CHANGED_WHEN");
|
|
entity.Property(e => e.ChangedWho)
|
|
.HasMaxLength(30)
|
|
.IsUnicode(false)
|
|
.HasColumnName("CHANGED_WHO");
|
|
});
|
|
|
|
OnModelCreatingPartial(modelBuilder);
|
|
}
|
|
|
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
}
|