Manarah/Manarah.App/Data/ManarahContext.cs
2024-03-28 22:29:14 +00:00
Ask

19 lines
531 B
C#

{3172b5b6932220a08cfd0c990266c4c27e980b8f true 531 ManarahContext.cs 0xc002b74ee0}

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; }
}
}