修复cross join下无法获取分片表对象的bug
This commit is contained in:
parent
5166bf01d7
commit
a944c402a0
|
@ -107,8 +107,14 @@ namespace Sample.MySql.Controllers
|
|||
name = o.Key.Name,
|
||||
count = o.Count()
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var x=await (from ut in _defaultTableDbContext.Set<SysTest>()
|
||||
from uu in _defaultTableDbContext.Set<SysUserMod>()
|
||||
where ut.Id == uu.Id
|
||||
select ut).FirstOrDefaultAsync();
|
||||
var x1=await (from ut in _defaultTableDbContext.Set<SysUserMod>()
|
||||
from uu in _defaultTableDbContext.Set<SysTest>()
|
||||
where ut.Id == uu.Id
|
||||
select ut).FirstOrDefaultAsync();
|
||||
// var firstOrDefault = _defaultTableDbContext.Set<SysUserMod>().FromSqlRaw($"select * from {nameof(SysUserMod)}").FirstOrDefault();
|
||||
|
||||
var sysUserMods1 = _defaultTableDbContext.Set<SysTest>().UseConnectionMode(1)
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors
|
|||
return base.VisitExtension(node);
|
||||
}
|
||||
#endif
|
||||
|
||||
private void TryAddShardingEntities(Type entityType, IQueryable queryable)
|
||||
{
|
||||
if (!shardingEntities.ContainsKey(entityType))
|
||||
|
@ -130,10 +131,14 @@ namespace ShardingCore.Sharding.Parsers.Visitors
|
|||
case nameof(EntityFrameworkQueryableExtensions.AsNoTracking): isNoTracking = true; break;
|
||||
case nameof(EntityFrameworkQueryableExtensions.AsTracking): isNoTracking = false; break;
|
||||
case nameof(EntityFrameworkQueryableExtensions.IgnoreQueryFilters): isIgnoreFilter = true; break;
|
||||
case nameof(EntityFrameworkQueryableExtensions.Include):
|
||||
case nameof(EntityFrameworkQueryableExtensions.ThenInclude): DiscoverQueryEntities(node); break;
|
||||
// case nameof(EntityFrameworkQueryableExtensions.Include):
|
||||
// case nameof(EntityFrameworkQueryableExtensions.ThenInclude): DiscoverQueryEntities(node); break;
|
||||
default:
|
||||
{
|
||||
if (node.Method.ReturnType.IsMethodReturnTypeQueryableType()&&node.Method.ReturnType.IsGenericType)
|
||||
{
|
||||
DiscoverQueryEntities(node);
|
||||
}
|
||||
var customerExpression = DiscoverCustomerQueryEntities(node);
|
||||
if (customerExpression != null)
|
||||
{
|
||||
|
@ -199,6 +204,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors
|
|||
for (var i = 0; i < genericArguments.Length; i++)
|
||||
{
|
||||
var genericArgument = genericArguments[i];
|
||||
|
||||
if (typeof(IEnumerable).IsAssignableFrom(genericArgument))
|
||||
{
|
||||
var arguments = genericArgument.GetGenericArguments();
|
||||
|
|
Loading…
Reference in New Issue