private async Task SignInAsync(User user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await _userManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }
public async Task Update(User user) { _session.Users.Attach(user); _session.Entry(user).Property(u => u.Active).IsModified = true; _session.Entry(user).Property(u => u.Company).IsModified = true; _session.Entry(user).Property(u => u.Email).IsModified = true; _session.Entry(user).Property(u => u.UserName).IsModified = true; await _session.SaveChangesAsync(); }
public Task Create(User user) { _session.Users.Add(user); return _session.SaveChangesAsync(); }