You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.IntegrationTests/Model30/Context.cs

22 lines
582 B
C#

using System;
using Microsoft.EntityFrameworkCore;
namespace EntityFrameworkCore.Jet.IntegrationTests.Model30
{
public class Context(DbContextOptions options) : DbContext(options)
{
public DbSet<Answer> Answers { get; set; }
public DbSet<Question> Questions { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Question>()
.HasMany(q => q.Answers)
.WithOne(x => x.Question);
base.OnModelCreating(modelBuilder);
}
}
}