21 lines
647 B
C#
21 lines
647 B
C#
using System.Net;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Authinator.Backend.Database.Tables;
|
|
|
|
public record Network {
|
|
public int Id { get; set; }
|
|
public string Name { get; set; } = null!;
|
|
public IPAddress Subnet { get; set; } = null!;
|
|
|
|
public class Configuration : IEntityTypeConfiguration<Network> {
|
|
public void Configure(EntityTypeBuilder<Network> group) {
|
|
group.ToTable("Networks");
|
|
group.HasKey(p => p.Id);
|
|
group.Property(b => b.Name).HasColumnName("Name").IsRequired();
|
|
group.Property(b => b.Name).HasColumnName("Subnet").IsRequired();
|
|
}
|
|
}
|
|
}
|