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.
27 lines
785 B
C#
27 lines
785 B
C#
using System;
|
|
using System.Data.Common;
|
|
using EntityFrameworkCore.Jet;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace EntityFrameworkCore.Jet.IntegrationTests.Model10
|
|
{
|
|
public class TestContext(DbConnection connection)
|
|
: DbContext(new DbContextOptionsBuilder<TestContext>().UseJet(connection).Options)
|
|
{
|
|
public DbSet<SomeClass> SomeClasses { get; set; }
|
|
public DbSet<Behavior> Behaviors { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.Entity<SomeClass>()
|
|
.HasOne(s => s.Behavior)
|
|
.WithOne()
|
|
.IsRequired()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
}
|
|
}
|
|
}
|