From 05dd01e776d8aa8ae3ac888b387431cc3eef9879 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Sun, 13 Aug 2023 13:01:02 +0330 Subject: [PATCH] Fix Reload in update package --- .../EasyMicroservices.Cores.AspCoreApi.csproj | 2 +- .../Database/Logics/DatabaseLogicInfrastructure.cs | 1 + .../EasyMicroservices.Cores.Database.csproj | 4 ++-- .../EasyMicroservices.Cores.EntityFrameworkCore.csproj | 4 ++-- ...icroservices.Cores.Relational.EntityFrameworkCore.csproj | 4 ++-- .../DatabaseLogics/LongIdMappedDatabaseLogicBaseTest.cs | 6 +++++- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj b/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj index f0164eb..4cbd03e 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj +++ b/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.14 + 0.0.0.15 asp core servces. EasyMicroservices@gmail.com core,cores,base,database,services,asp,aspnet diff --git a/src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs b/src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs index 99c1955..1f14064 100644 --- a/src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs +++ b/src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs @@ -320,6 +320,7 @@ private async Task> InternalUpdate(IEasyWritab easyWritableQueryable.Context.ChangeModificationPropertyState(result.Entity, nameof(ISoftDeleteSchema.IsDeleted), false); } await easyWritableQueryable.SaveChangesAsync(); + await easyWritableQueryable.Context.Reload(result.Entity, cancellationToken); return result.Entity; } diff --git a/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj b/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj index 36a773b..ff598ff 100644 --- a/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.16 + 0.0.0.17 core of database. EasyMicroservices@gmail.com core,cores,base,database @@ -17,7 +17,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj index aab1e35..e30e9e2 100644 --- a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.7 + 0.0.0.8 ef core of database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore @@ -16,7 +16,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj index b08ad93..32caefd 100644 --- a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj @@ -1,11 +1,11 @@ - + net6.0 AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 ef core of Relational database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore,Relational diff --git a/src/CSharp/EasyMicroservices.Cores.Tests/DatabaseLogics/LongIdMappedDatabaseLogicBaseTest.cs b/src/CSharp/EasyMicroservices.Cores.Tests/DatabaseLogics/LongIdMappedDatabaseLogicBaseTest.cs index 0caee5f..bd8f6a4 100644 --- a/src/CSharp/EasyMicroservices.Cores.Tests/DatabaseLogics/LongIdMappedDatabaseLogicBaseTest.cs +++ b/src/CSharp/EasyMicroservices.Cores.Tests/DatabaseLogics/LongIdMappedDatabaseLogicBaseTest.cs @@ -90,12 +90,16 @@ public async Task UpdateAsync(string userName, string toUserName) await using var logic = GetUpdateContractLogic(); var added = await AddAsync(userName); added.UserName = toUserName; - await logic.Update(new UpdateUserContract() + var updateResult = await logic.Update(new UpdateUserContract() { Id = added.Id, UniqueIdentity = added.UniqueIdentity, UserName = added.UserName }); + Assert.NotNull(updateResult.Result.ModificationDateTime); + Assert.Equal(updateResult.Result.CreationDateTime, added.CreationDateTime); + Assert.True(updateResult.Result.CreationDateTime > DateTime.Now.AddMinutes(-5)); + Assert.True(updateResult.Result.ModificationDateTime > DateTime.Now.AddMinutes(-5)); var found = await logic.GetById(new GetIdRequestContract() { Id = added.Id