コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
 public async Task SaveAsync()
 {
     await BlockChainContext.SaveChangesAsync();
 }