x.3.2.7修复单路由多表的bug
This commit is contained in:
parent
c3b55c5af9
commit
4fdb273ead
|
@ -1,9 +1,9 @@
|
|||
:start
|
||||
::定义版本
|
||||
set EFCORE2=2.3.2.06
|
||||
set EFCORE3=3.3.2.06
|
||||
set EFCORE5=5.3.2.06
|
||||
set EFCORE6=6.3.2.06
|
||||
set EFCORE2=2.3.2.07
|
||||
set EFCORE3=3.3.2.07
|
||||
set EFCORE5=5.3.2.07
|
||||
set EFCORE6=6.3.2.07
|
||||
|
||||
::删除所有bin与obj下的文件
|
||||
@echo off
|
||||
|
|
|
@ -11,6 +11,9 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ShardingCore;
|
||||
using ShardingCore.Core.VirtualDatabase.VirtualTables;
|
||||
using ShardingCore.Core.VirtualRoutes.TableRoutes.RoutingRuleEngine;
|
||||
|
||||
namespace Sample.SqlServer.Controllers
|
||||
{
|
||||
|
@ -35,6 +38,14 @@ namespace Sample.SqlServer.Controllers
|
|||
[HttpGet]
|
||||
public async Task<IActionResult> Get2x()
|
||||
{
|
||||
//var queryable = _defaultTableDbContext.Set<SysUserMod>().Where(o=>true);
|
||||
|
||||
//var tableRouteRuleEngineFactory = ShardingContainer.GetService<ITableRouteRuleEngineFactory<DefaultShardingDbContext>>();
|
||||
//var tableRouteResults = tableRouteRuleEngineFactory.Route(queryable);
|
||||
var virtualTableManager = ShardingContainer.GetService<IVirtualTableManager<DefaultShardingDbContext>>();
|
||||
var virtualTable = virtualTableManager.GetVirtualTable<SysUserMod>();
|
||||
var virtualTableRoute = virtualTable.GetVirtualRoute();
|
||||
var allTails = virtualTableRoute.GetAllTails();
|
||||
Console.WriteLine("------------------Get2x------------------------");
|
||||
using (var dbContext =
|
||||
DbContextHelper.CreateDbContextByString(
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace ShardingCore.Sharding.ShardingExecutors
|
|||
if (hasQueryCompilerExecutor.Value)
|
||||
{
|
||||
var routeTailFactory = ShardingContainer.GetService<IRouteTailFactory>();
|
||||
var dbContext = GetShardingDbContext().GetDbContext(_dataSourceRouteResult.IntersectDataSources.First(), CurrentQueryReadConnection(), routeTailFactory.Create(_tableRouteResults.First()));
|
||||
var dbContext = GetShardingDbContext().GetDbContext(_dataSourceRouteResult.IntersectDataSources.First(), !IsQueryTrack() || CurrentQueryReadConnection(), routeTailFactory.Create(_tableRouteResults.First()));
|
||||
_queryCompilerExecutor = new QueryCompilerExecutor(dbContext, GetQueryExpression());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,8 +36,24 @@ namespace ShardingCore.Test.Shardings
|
|||
return true;
|
||||
}
|
||||
}
|
||||
//public class HistoryMinCompare : IComparer<string>
|
||||
//{
|
||||
// private const string History = "History";
|
||||
|
||||
public class OrderCreateTimePaginationConfiguration : IPaginationConfiguration<Order>
|
||||
// public int Compare(string? x, string? y)
|
||||
// {
|
||||
// if (!Object.Equals(x, y))
|
||||
// {
|
||||
// if (History.Equals(x))
|
||||
// return -1;
|
||||
// if (History.Equals(y))
|
||||
// return 1;
|
||||
// }
|
||||
// return Comparer<string>.Default.Compare(x, y);
|
||||
// }
|
||||
//}
|
||||
|
||||
public class OrderCreateTimePaginationConfiguration : IPaginationConfiguration<Order>
|
||||
{
|
||||
public void Configure(PaginationBuilder<Order> builder)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue