19 lines
531 B
C#
19 lines
531 B
C#
|
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; }
|
|||
|
}
|
|||
|
}
|