Compare commits
9 Commits
d7b7c2eb88
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 584d036a09 | |||
| 1da2dd8579 | |||
| b434383f7e | |||
| 3f1371e33a | |||
| 9c1da388d8 | |||
| 1edcafdebd | |||
| 93461fd35e | |||
| 52c9c9ab9e | |||
| 4020981eec |
@@ -6,8 +6,8 @@
|
|||||||
<!-- HrynCo shared packages -->
|
<!-- HrynCo shared packages -->
|
||||||
<PackageVersion Include="HrynCo.Common" Version="1.0.0" />
|
<PackageVersion Include="HrynCo.Common" Version="1.0.0" />
|
||||||
<!-- Entity Framework Core -->
|
<!-- Entity Framework Core -->
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.15" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.7" />
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" />
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.15" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.7" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
<Description>Abstract DAL contracts for HrynCo applications: entities, repository and unit-of-work interfaces.</Description>
|
<Description>Abstract DAL contracts for HrynCo applications: entities, repository and unit-of-work interfaces.</Description>
|
||||||
<PackageTags>hrynco dal abstract entity repository unitofwork</PackageTags>
|
<PackageTags>hrynco dal abstract entity repository unitofwork</PackageTags>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://gitea.grynco.com.ua/hrynco/hrynco-ef.git</RepositoryUrl>
|
<RepositoryUrl>https://gitea.hrynco.com/hrynco/hrynco-ef.git</RepositoryUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
|||||||
{
|
{
|
||||||
foreach (TEntity entity in entities)
|
foreach (TEntity entity in entities)
|
||||||
{
|
{
|
||||||
Add(entity, save);
|
Add(entity, save: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (save)
|
||||||
|
{
|
||||||
|
DbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +89,11 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
|||||||
|
|
||||||
public async Task DeleteAsync(TEntityId id)
|
public async Task DeleteAsync(TEntityId id)
|
||||||
{
|
{
|
||||||
Delete(id);
|
TEntity? entity = await GetByIdAsync(id);
|
||||||
|
if (entity != null)
|
||||||
|
{
|
||||||
|
DoRemove(entity);
|
||||||
|
}
|
||||||
await DbContext.SaveChangesAsync();
|
await DbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Description>Entity Framework Core base implementations for HrynCo applications: generic repository and unit-of-work.</Description>
|
<Description>Entity Framework Core base implementations for HrynCo applications: generic repository and unit-of-work.</Description>
|
||||||
<PackageTags>hrynco dal ef entityframework repository unitofwork</PackageTags>
|
<PackageTags>hrynco dal ef entityframework repository unitofwork</PackageTags>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://gitea.grynco.com.ua/hrynco/hrynco-ef.git</RepositoryUrl>
|
<RepositoryUrl>https://gitea.hrynco.com/hrynco/hrynco-ef.git</RepositoryUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -28,3 +28,4 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user