示例#1
0
        public bool UpdateTicketValidation(int ticketId)
        {
            bool isTicketExist = _context.Tickets.Any(t => t.TicketId == ticketId);

            if (isTicketExist)
            {
                var ticket = _context.Tickets.Single(t => t.TicketId == ticketId);
                ticket.Validated = true;
                _context.SaveChanges();
                return(true);
            }

            return(false);
        }
示例#2
0
        public async Task <IdentityResult> RegisterUser(UserRegisterModel userModel, UserManager <Actor> userManager)
        {
            Actor user = new Actor()
            {
                UserName = userModel.UserName
            };

            var result = await userManager.CreateAsync(user, userModel.Password);

            _context.SaveChanges();
            return(result);
        }