model and Dto

This commit is contained in:
mmrbnjd
2025-06-28 15:31:07 +03:30
parent 1f6ca5ee5f
commit c0b47129d4
38 changed files with 905 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using Hushian.Domain.Entites;
using Microsoft.EntityFrameworkCore;
namespace Hushian.Persistence
{
public class HushianDbContext : DbContext
{
public HushianDbContext(DbContextOptions<HushianDbContext> options)
:base(options)
{
}
#region Table
public DbSet<Company> Companies { get; set; }
public DbSet<Conversation> Conversations { get; set; }
public DbSet<ConversationItem> ConversationItems { get; set; }
public DbSet<Group> Groups { get; set; }
public DbSet<Exper> Expers { get; set; }
public DbSet<ExperGroup> EG { get; set; }
public DbSet<User> Users { get; set; }
#endregion
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<ExperGroup>().HasKey(c => new { c.ExperID, c.GroupID });
modelBuilder
.ApplyConfigurationsFromAssembly(typeof(HushianDbContext).Assembly);
}
}
}