|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore.TestApp.SecondContext; |
|
|
|
using Volo.Abp.EntityFrameworkCore.TestApp.ThirdDbContext; |
|
|
|
@ -16,10 +17,10 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
public DbSet<BookInSecondDbContext> Books { get; set; } |
|
|
|
|
|
|
|
public DbSet<EntityWithIntPk> EntityWithIntPks { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public DbSet<Author> Author { get; set; } |
|
|
|
|
|
|
|
public TestMigrationsDbContext(DbContextOptions<TestMigrationsDbContext> options) |
|
|
|
|
|
|
|
public TestMigrationsDbContext(DbContextOptions<TestMigrationsDbContext> options) |
|
|
|
: base(options) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -36,6 +37,12 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
b.HasKey(p => new { p.PersonId, p.Number }); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity<Person>(b => |
|
|
|
{ |
|
|
|
b.Property(x => x.LastActiveTime).ValueGeneratedOnAddOrUpdate().HasDefaultValue(DateTime.Now); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity<City>(b => |
|
|
|
{ |
|
|
|
b.OwnsMany(c => c.Districts, d => |
|
|
|
|