Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Reload in update package #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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