Next Estimated Chapter (#2342)

This commit is contained in:
Joe Milazzo 2023-10-22 10:44:26 -05:00 committed by GitHub
parent ca5afe94d3
commit de9b09c71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 433 additions and 73 deletions

View file

@ -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>