Skip to content

Commit

Permalink
Fix Reload in update package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Aug 13, 2023
1 parent 376fb33 commit 05dd01e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.14</Version>
<Version>0.0.0.15</Version>
<Description>asp core servces.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,services,asp,aspnet</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ private async Task<MessageContract<TEntity>> InternalUpdate<TEntity>(IEasyWritab
easyWritableQueryable.Context.ChangeModificationPropertyState(result.Entity, nameof(ISoftDeleteSchema.IsDeleted), false);
}
await easyWritableQueryable.SaveChangesAsync();
await easyWritableQueryable.Context.Reload(result.Entity, cancellationToken);
return result.Entity;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.16</Version>
<Version>0.0.0.17</Version>
<Description>core of database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database</PackageTags>
Expand All @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Database" Version="0.0.0.6" />
<PackageReference Include="EasyMicroservices.Database" Version="0.0.0.7" />
<PackageReference Include="EasyMicroservices.Mapper" Version="0.0.0.4" />
<PackageReference Include="EasyMicroservices.ServiceContracts" Version="0.0.0.6" />
<PackageReference Include="EasyMicroservices.Utilities" Version="0.0.0.11" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.7</Version>
<Version>0.0.0.8</Version>
<Description>ef core of database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,ef,efcore</PackageTags>
Expand All @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Database.EntityFrameworkCore" Version="0.0.0.7" />
<PackageReference Include="EasyMicroservices.Database.EntityFrameworkCore" Version="0.0.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.5</Version>
<Description>ef core of Relational database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,ef,efcore,Relational</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<long>()
{
Id = added.Id
Expand Down

0 comments on commit 05dd01e

Please sign in to comment.