diff --git a/nuget-publish.bat b/nuget-publish.bat index 7848ca9c..0fead255 100644 --- a/nuget-publish.bat +++ b/nuget-publish.bat @@ -1,9 +1,9 @@ :start ::定义版本 -set EFCORE2=2.3.1.84 -set EFCORE3=3.3.1.84 -set EFCORE5=5.3.1.84 -set EFCORE6=6.3.1.84 +set EFCORE2=2.3.1.85 +set EFCORE3=3.3.1.85 +set EFCORE5=5.3.1.85 +set EFCORE6=6.3.1.85 ::删除所有bin与obj下的文件 @echo off diff --git a/samples/Sample.SqlServer/Controllers/ValuesController.cs b/samples/Sample.SqlServer/Controllers/ValuesController.cs index e0a91c9d..8f7e5a8a 100644 --- a/samples/Sample.SqlServer/Controllers/ValuesController.cs +++ b/samples/Sample.SqlServer/Controllers/ValuesController.cs @@ -47,16 +47,21 @@ namespace Sample.SqlServer.Controllers [HttpGet] public async Task Get() { - var sql = from ut in _defaultTableDbContext.Set() - join u in _defaultTableDbContext.Set() - on ut.UserId equals u.Id - select new - { - ut.Id, - userId = u.Id - }; - var listAsync = await sql.ToListAsync(); - var resultx112331tt = await _defaultTableDbContext.Set().AsNoTracking().CountAsync(); + //var sql = from ut in _defaultTableDbContext.Set() + // join u in _defaultTableDbContext.Set() + // on ut.UserId equals u.Id + // select new + // { + // ut.Id, + // userId = u.Id + // }; + //var listAsync = await sql.ToListAsync(); + //var resultx112331tt = await _defaultTableDbContext.Set().AsNoTracking().CountAsync(); + var resultx112331tt2 = await _defaultTableDbContext.Set().FirstOrDefaultAsync(o=>o.Id=="2"); + var resultx112331ttaa2 = await _defaultTableDbContext.Set().FirstOrDefaultAsync(o=>o.Id=="2"); + resultx112331ttaa2.UserId = "zzzz"; + var resultx112331tt2xx = await _defaultTableDbContext.Set().Where(o => o.Id == "2").FirstOrDefaultAsync(); + resultx112331tt2xx.UserId = "xxxxx"; var resultx112331 = await _defaultTableDbContext.Set().CountAsync(); var resultx11233411 = _defaultTableDbContext.Set().Count(); var resultx11231 = await _defaultTableDbContext.Set().Where(o => o.Age == 198198).Select(o => o.Id).ContainsAsync("1981"); diff --git a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs index 0d4336d3..970604d0 100644 --- a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs +++ b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs @@ -81,7 +81,7 @@ namespace ShardingCore.EFCores } return _shardingQueryExecutor.ExecuteAsync(_currentContext, query, cancellationToken); } - throw new ShardingCoreException("db context operator is not IShardingDbContext"); + throw new ShardingCoreException("db context operator is not IShardingDbContext"); } [ExcludeFromCodeCoverage] @@ -90,12 +90,6 @@ namespace ShardingCore.EFCores throw new NotImplementedException(); } - [ExcludeFromCodeCoverage] - public Func> CreateCompiledAsyncTaskQuery(Expression query) - { - throw new NotImplementedException(); - } - [ExcludeFromCodeCoverage] public Func CreateCompiledAsyncQuery(Expression query) { diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/NoShardingFirstComparer.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/NoShardingFirstComparer.cs index 6df5c43c..30607529 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/NoShardingFirstComparer.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/NoShardingFirstComparer.cs @@ -35,10 +35,13 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors /// public int Compare(string? x, string? y) { - if (_defaultTail.Equals(x)) - return -1; - if (_defaultTail.Equals(y)) - return 1; + if (!Object.Equals(x, y)) + { + if (_defaultTail.Equals(x)) + return -1; + if (_defaultTail.Equals(y)) + return 1; + } return Comparer.Default.Compare(x, y); } }