namespace house_plant_api.Context { using house_plant_api.Models; using Microsoft.EntityFrameworkCore; public class AppDbContext : DbContext { public DbSet Devices { get; set; } public AppDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity() .HasKey(d => d.Id); modelBuilder.Entity() .Property(d => d.Name) .IsRequired(); modelBuilder.Entity() .Property(d => d.Nickname); modelBuilder.Entity() .Property(d => d.Uuid) .IsRequired(); } } }