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.FunctionalTests/MonsterFixupChangedChanging...

52 lines
2.3 KiB
C#

// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using EntityFrameworkCore.Jet.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.TestUtilities;
namespace EntityFrameworkCore.Jet.FunctionalTests
{
public class MonsterFixupChangedChangingJetTest :
MonsterFixupTestBase<MonsterFixupChangedChangingJetTest.MonsterFixupChangedChangingJetFixture>
{
public MonsterFixupChangedChangingJetTest(MonsterFixupChangedChangingJetFixture fixture)
: base(fixture)
{
}
public class MonsterFixupChangedChangingJetFixture : MonsterFixupChangedChangingFixtureBase
{
protected override ITestStoreFactory TestStoreFactory => JetTestStoreFactory.Instance;
protected override void OnModelCreating<TMessage, TProduct, TProductPhoto, TProductReview, TComputerDetail, TDimensions>(
ModelBuilder builder)
{
base.OnModelCreating<TMessage, TProduct, TProductPhoto, TProductReview, TComputerDetail, TDimensions>(builder);
builder.Entity<TMessage>().Property(e => e.MessageId).UseIdentityColumn();
builder.Entity<TProduct>()
.OwnsOne(
c => (TDimensions)c.Dimensions, db =>
{
db.Property(d => d.Depth).HasColumnType("decimal(18,2)");
db.Property(d => d.Width).HasColumnType("decimal(18,2)");
db.Property(d => d.Height).HasColumnType("decimal(18,2)");
});
builder.Entity<TProductPhoto>().Property(e => e.PhotoId).UseIdentityColumn();
builder.Entity<TProductReview>().Property(e => e.ReviewId).UseIdentityColumn();
builder.Entity<TComputerDetail>()
.OwnsOne(
c => (TDimensions)c.Dimensions, db =>
{
db.Property(d => d.Depth).HasColumnType("decimal(18,2)");
db.Property(d => d.Width).HasColumnType("decimal(18,2)");
db.Property(d => d.Height).HasColumnType("decimal(18,2)");
});
}
}
}
}