File: MyDb2Context.cs
Web Access
Project: src\playground\SqlServerEndToEnd\SqlServerEndToEnd.Common\SqlServerEndToEnd.Common.csproj (SqlServerEndToEnd.Common)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using Microsoft.EntityFrameworkCore;
 
namespace SqlServerEndToEnd.Common;
 
public class MyDb2Context(DbContextOptions<MyDb2Context> options) : DbContext(options)
{
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
 
        modelBuilder.Entity<Entry>().HasKey(e => e.Id);
    }
 
    public DbSet<Entry> Entries { get; set; }
}