public User SaveUser(User user) { using (Database db = DbFactory.PayDbFactory.GetDatabase()) { db.Save<User>(user); return user; } }
public BasicPrincipal(User user, string clientName) { if (user == null) { throw new ArgumentNullException("user"); } Identity = new GenericIdentity(user.Username); Id = user.Id; ClientId = user.ClientId; Username = user.Username; ClientName = clientName; }
public ActionResult Create(AddEditUserViewModel input) { try { User user = new User { Username = input.Username, ClientId = input.ClientId, Password = input.Password }; _adminRepo.SaveUser(user); return RedirectToAction("Index"); } catch { return View(); } }