Next Estimated Chapter (#2342)
This commit is contained in:
parent
ca5afe94d3
commit
de9b09c71f
32 changed files with 433 additions and 73 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using API.Data.Repositories;
|
||||
using API.Entities;
|
||||
using API.Services;
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ public class UnitOfWork : IUnitOfWork
|
|||
private readonly DataContext _context;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly UserManager<AppUser> _userManager;
|
||||
private readonly ILocalizationService _localizationService;
|
||||
|
||||
public UnitOfWork(DataContext context, IMapper mapper, UserManager<AppUser> userManager)
|
||||
{
|
||||
|
|
@ -99,6 +101,16 @@ public class UnitOfWork : IUnitOfWork
|
|||
return _context.ChangeTracker.HasChanges();
|
||||
}
|
||||
|
||||
public async Task BeginTransactionAsync()
|
||||
{
|
||||
await _context.Database.BeginTransactionAsync();
|
||||
}
|
||||
|
||||
public async Task CommitTransactionAsync()
|
||||
{
|
||||
await _context.Database.CommitTransactionAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rollback transaction
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue