Ejemplo n.º 1
0
        public async Task SignUpAsync(IBoxBoxContext context, CancellationToken cancellationToken)
        {
            PasswordHasher <Account> passwordHasher = new PasswordHasher <Account>();

            Account contextEntity = new Account
            {
                Login       = _account.Login,
                Email       = _account.Email,
                IsSuperUser = false,
                IsOwner     = false,
                Created     = DateTime.Now
            };

            if (context.Account.Count() == 0)
            {
                contextEntity.IsSuperUser = true;
                contextEntity.IsOwner     = true;
            }

            contextEntity.Password = passwordHasher.HashPassword(contextEntity, _account.Password);

            await context.Account.AddAsync(contextEntity);

            await context.SaveChangesAsync(cancellationToken);
        }
 public GetFoodTypesCommandHandler(IBoxBoxContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public GetFoodCountQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public DeleteOrderStateCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public GetSelectedItemsQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public CreateOrderCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public ChangeOrderStateCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public SignInAccountQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 9
0
 public GetOrderStatesQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 10
0
 public DeleteFoodTypeCommandHandler(IBoxBoxContext dbContext)
 {
     this.dbContext = dbContext;
 }
Ejemplo n.º 11
0
 public GetUserListCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 12
0
 public ChangeRoleCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 13
0
 public CreateAccountCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public GetFoodsListQueryHandle(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 15
0
 public GetFoodTypesQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }
Ejemplo n.º 16
0
 public CreateFoodCommandHandler(IBoxBoxContext context)
 {
     _context = context;
 }
 public GetFoodDetailQueryHandler(IBoxBoxContext context)
 {
     _context = context;
 }