27 lines
800 B
C#

using Microsoft.EntityFrameworkCore;
using BackupPipefy.Domain.Entities;
namespace BackupPipefy.Infrastructure.Data
{
public class BackupContext : DbContext
{
public DbSet<PipefyCard> PipefyCards { get; set; }
public DbSet<BackupLog> BackupLogs { get; set; }
public DbSet<BackupControl> BackupControls { get; set; }
public BackupContext(DbContextOptions<BackupContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<PipefyCard>()
.HasKey(c => c.Id);
modelBuilder.Entity<BackupLog>()
.HasKey(l => l.LogId);
modelBuilder.Entity<BackupControl>()
.HasKey(c => c.Id);
}
}
}