Newer
Older
NoteApi / Data / DbContext.cs
@fabre fabre on 28 Jan 569 bytes SensorReadings
using Microsoft.EntityFrameworkCore;

public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options)
        : base(options) { }

    public DbSet<HololiveSchedule> HololiveSchedule => Set<HololiveSchedule>();
    public DbSet<PixivImage> PixivImages => Set<PixivImage>();
    public DbSet<SensorReading> SensorReadings => Set<SensorReading>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<SensorReading>()
            .HasKey(x => new { x.Ts, x.Location });
    }
}