27 lines
930 B
C#
27 lines
930 B
C#
|
using NG_2023_Kanban.Entities;
|
|||
|
using NG_2023_Kanban.EntityConfiguration;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
|||
|
namespace NG_2023_Kanban.DbStartup
|
|||
|
{
|
|||
|
public class DatabaseContext : DbContext
|
|||
|
{
|
|||
|
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options) { }
|
|||
|
|
|||
|
public DbSet<Board> Boards { get; set; }
|
|||
|
public DbSet<Comment> Comments { get; set; }
|
|||
|
public DbSet<Card> Cards { get; set; }
|
|||
|
public DbSet<User> Users { get; set; }
|
|||
|
|
|||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|||
|
{
|
|||
|
modelBuilder.ApplyConfiguration(new BoardConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new CommentConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new CardConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new UserConfiguration());
|
|||
|
|
|||
|
base.OnModelCreating(modelBuilder);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|