Manarah/Manarah.App/Data/ManarahContext.cs

19 lines
531 B
C#
Raw Normal View History

using Manarah.Domain;
using Microsoft.EntityFrameworkCore;
namespace Manarah.App.Data
{
public class ManarahContext:DbContext
{
public ManarahContext(DbContextOptions<ManarahContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Server>().ToTable(nameof(Server));
modelBuilder.Entity<Server>().HasKey(model => model.IPAddress);
}
public DbSet<Server> Servers { get; set; }
}
}