sharding/samples/Samples.AutoByDate.SqlServer/DbContexts/DefaultShardingDbContext.cs

23 lines
700 B
C#

using System;
using Microsoft.EntityFrameworkCore;
using Samples.AutoByDate.SqlServer.Domain.Maps;
using ShardingCore.Sharding;
namespace Samples.AutoByDate.SqlServer.DbContexts
{
public class DefaultShardingDbContext:AbstractShardingDbContext<DefaultTableDbContext>
{
public DefaultShardingDbContext(DbContextOptions<DefaultShardingDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfiguration(new SysUserLogByDayMap());
}
public override Type ShardingDbContextType => this.GetType();
}
}