This commit is contained in:
2026-06-02 16:25:57 +08:00
24 changed files with 285 additions and 53 deletions
+25
View File
@@ -0,0 +1,25 @@
using IM.Application.Abstractions;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IM.Infrastructure.Efcore
{
public sealed class EfUnitOfWork<TDbContext> : IUnitOfWork where TDbContext : DbContext
{
private readonly TDbContext dbContext;
public EfUnitOfWork(TDbContext dbContext)
{
this.dbContext = dbContext;
}
public Task SaveChangesAsync(CancellationToken cancellationToken = default)
{
return dbContext.SaveChangesAsync(cancellationToken);
}
}
}
+1
View File
@@ -13,6 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\DomainCommons\IM.DomainCommons.csproj" />
<ProjectReference Include="..\IM.Application\IM.Application.csproj" />
</ItemGroup>
</Project>