public void AddUser(ServiceUser user)
 {
     using (var currentContext = new PizzaSericeContext())
     {
         currentContext.ServiceUsers.Add(user);
         currentContext.SaveChanges();
     }
 }
        public async Task<ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                ServiceUser serviceUser = new ServiceUser
                {
                    Name = model.UserName,
                    RoleId = 2
                };
                ServiceUserRepository.Instance.AddUser(serviceUser);
                var user = new ApplicationUser() { UserName = model.UserName };
                var result = await UserManager.CreateAsync(user, model.Password);
                if (result.Succeeded)
                {
                    await SignInAsync(user, isPersistent: false);
                    return RedirectToAction("Index", "Home");
                }
                else
                {
                    AddErrors(result);
                }
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }