5 Commits

3 changed files with 6 additions and 17 deletions
@@ -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,8 +10,7 @@
<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.hrynco.com/hrynco/hrynco-ef.git</RepositoryUrl> <RepositoryUrl>https://gitea.grynco.com.ua/hrynco/hrynco-ef.git</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
+2 -11
View File
@@ -40,12 +40,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
{ {
foreach (TEntity entity in entities) foreach (TEntity entity in entities)
{ {
Add(entity, save: false); Add(entity, save);
}
if (save)
{
DbContext.SaveChanges();
} }
} }
@@ -89,11 +84,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
public async Task DeleteAsync(TEntityId id) public async Task DeleteAsync(TEntityId id)
{ {
TEntity? entity = await GetByIdAsync(id); Delete(id);
if (entity != null)
{
DoRemove(entity);
}
await DbContext.SaveChangesAsync(); await DbContext.SaveChangesAsync();
} }
+2 -3
View File
@@ -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.hrynco.com/hrynco/hrynco-ef.git</RepositoryUrl> <RepositoryUrl>https://gitea.grynco.com.ua/hrynco/hrynco-ef.git</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -28,4 +28,3 @@
</ItemGroup> </ItemGroup>
</Project> </Project>