4 Commits

4 changed files with 9 additions and 20 deletions
+3 -3
View File
@@ -6,8 +6,8 @@
<!-- HrynCo shared packages -->
<PackageVersion Include="HrynCo.Common" Version="1.0.0" />
<!-- Entity Framework Core -->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.15" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.15" />
</ItemGroup>
</Project>
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
@@ -10,8 +10,7 @@
<Description>Abstract DAL contracts for HrynCo applications: entities, repository and unit-of-work interfaces.</Description>
<PackageTags>hrynco dal abstract entity repository unitofwork</PackageTags>
<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>
</Project>
+2 -11
View File
@@ -40,12 +40,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
{
foreach (TEntity entity in entities)
{
Add(entity, save: false);
}
if (save)
{
DbContext.SaveChanges();
Add(entity, save);
}
}
@@ -89,11 +84,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
public async Task DeleteAsync(TEntityId id)
{
TEntity? entity = await GetByIdAsync(id);
if (entity != null)
{
DoRemove(entity);
}
Delete(id);
await DbContext.SaveChangesAsync();
}
+2 -3
View File
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
@@ -10,7 +10,7 @@
<Description>Entity Framework Core base implementations for HrynCo applications: generic repository and unit-of-work.</Description>
<PackageTags>hrynco dal ef entityframework repository unitofwork</PackageTags>
<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>
<ItemGroup>
@@ -28,4 +28,3 @@
</ItemGroup>
</Project>