mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
27 lines
571 B
C#
27 lines
571 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Streetwriters.Data.Interfaces;
|
|
|
|
namespace Streetwriters.Data
|
|
{
|
|
public class UnitOfWork : IUnitOfWork
|
|
{
|
|
private readonly IDbContext dbContext;
|
|
|
|
public UnitOfWork(IDbContext _dbContext)
|
|
{
|
|
dbContext = _dbContext;
|
|
}
|
|
|
|
public async Task<bool> Commit()
|
|
{
|
|
var changeAmount = await dbContext.SaveChanges();
|
|
return changeAmount > 0;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
this.dbContext.Dispose();
|
|
}
|
|
}
|
|
} |