/// <summary> /// Creating block repository /// </summary> /// <param name="context"></param> public BlockRepository(BlockChainContext context) { if (context == null) { throw new ArgumentNullException(nameof(context), " was null."); } _db = context; }
/// <summary> /// Creating unit of work /// </summary> /// <param name="context"></param> public UnitOfWork(BlockChainContext context, SignInManager <User> signInManager, UserManager <User> userManager) { if (context == null) { throw new ArgumentNullException(nameof(context), " was null."); } if (signInManager == null) { throw new ArgumentNullException(nameof(signInManager), " was null."); } if (userManager == null) { throw new ArgumentNullException(nameof(userManager), " was null."); } BlockChainContext = context; SignInManager = signInManager; UserManager = userManager; }
public async Task SaveAsync() { await BlockChainContext.SaveChangesAsync(); }