27 lines
820 B
C#
27 lines
820 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Sample.SqlServer.Domain.Maps;
|
|
using ShardingCore.Sharding;
|
|
|
|
namespace Sample.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 SysUserModMap());
|
|
modelBuilder.ApplyConfiguration(new SysTestMap());
|
|
}
|
|
|
|
public override Type ShardingDbContextType => this.GetType();
|
|
}
|
|
}
|