parent
7bab73c6e1
commit
ce1faf8d54
|
@ -1,6 +1,6 @@
|
|||
:start
|
||||
::定义版本
|
||||
set SHARDINGCORE7=7.0.0.4
|
||||
set SHARDINGCORE7=7.0.0.5
|
||||
set SHARDINGCORE2_6=6.8.0.9
|
||||
|
||||
::删除所有bin与obj下的文件
|
||||
|
|
|
@ -405,6 +405,16 @@ namespace Sample.SqlServer.Controllers
|
|||
s => s.SetProperty(b => b.Age, b => b.Age + 1));
|
||||
|
||||
|
||||
return Ok();
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Get9()
|
||||
|
||||
{
|
||||
|
||||
var resultx112331tt2 = await _defaultTableDbContext.Set<SysTest>().FromSqlRaw("select *from systest where id='3'").FirstOrDefaultAsync();
|
||||
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Reflection;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Internal;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using Microsoft.EntityFrameworkCore.Query.Internal;
|
||||
using ShardingCore.Core.Internal.Visitors;
|
||||
using ShardingCore.Exceptions;
|
||||
using ShardingCore.Extensions;
|
||||
|
@ -156,12 +157,24 @@ namespace ShardingCore.Core.Internal.Visitors
|
|||
var newQueryable = targetIQ.Provider.CreateQuery(targetIQ.Expression);
|
||||
if (Source == null)
|
||||
Source = newQueryable;
|
||||
RootIsVisit = true;
|
||||
|
||||
if (queryRootExpression is FromSqlQueryRootExpression fromSqlQueryRootExpression)
|
||||
{
|
||||
var sqlQueryRootExpression = new FromSqlQueryRootExpression(newQueryable.Provider as IAsyncQueryProvider,
|
||||
fromSqlQueryRootExpression.EntityType, fromSqlQueryRootExpression.Sql,
|
||||
fromSqlQueryRootExpression.Argument);
|
||||
|
||||
return base.VisitExtension(sqlQueryRootExpression);
|
||||
}
|
||||
else
|
||||
{
|
||||
//如何替换ef5的set
|
||||
var replaceQueryRoot = new ReplaceSingleQueryRootExpressionVisitor();
|
||||
replaceQueryRoot.Visit(newQueryable.Expression);
|
||||
RootIsVisit = true;
|
||||
return base.VisitExtension(replaceQueryRoot.QueryRootExpression);
|
||||
}
|
||||
}
|
||||
|
||||
return base.VisitExtension(node);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6;net7;</TargetFrameworks>
|
||||
<Version>7.0.0.4</Version>
|
||||
<Version>7.0.0.5</Version>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<DefineConstants>TRACE;DEBUG;SHARDINGCORE7;</DefineConstants>
|
||||
<LangVersion>latest</LangVersion>
|
||||
|
|
Loading…
Reference in New Issue