public async Task <TermsOfServiceModel> UpdateAsync(TermsOfServiceModel termsOfService) { a3SContext.Entry(termsOfService).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(termsOfService); }
public async Task <PermissionModel> UpdateAsync(PermissionModel permission) { a3SContext.Entry(permission).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(permission); }
public async Task <SubRealmModel> UpdateAsync(SubRealmModel subRealm) { a3SContext.Entry(subRealm).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(subRealm); }
public async Task <FunctionModel> UpdateAsync(FunctionModel function) { a3SContext.Entry(function).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(function); }
public async Task <ApplicationDataPolicyModel> UpdateAsync(ApplicationDataPolicyModel applicationDataPolicy) { a3SContext.Entry(applicationDataPolicy).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(applicationDataPolicy); }
public async Task <TeamModel> UpdateAsync(TeamModel team) { a3SContext.Entry(team).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(team); }
public async Task <ProfileModel> UpdateAsync(ProfileModel profile) { a3SContext.Entry(profile).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(profile); }
public async Task <UserModel> UpdateAsync(UserModel user) { a3SContext.Entry(user).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(user); }
public async Task <RoleModel> UpdateAsync(RoleModel role) { a3SContext.Entry(role).State = EntityState.Modified; await a3SContext.SaveChangesAsync(); return(role); }
private void UpdateUserField(UserModel appUser, string userField, string value) { switch (userField.ToLower()) { case "username": appUser.UserName = value; a3SContext.Entry(appUser).State = EntityState.Modified; break; case "firstname": appUser.FirstName = value; a3SContext.Entry(appUser).State = EntityState.Modified; break; case "surname": appUser.Surname = value; a3SContext.Entry(appUser).State = EntityState.Modified; break; case "email": appUser.Email = value; a3SContext.Entry(appUser).State = EntityState.Modified; break; case "avatar": var binaryFormatter = new BinaryFormatter(); using (var memoryStream = new MemoryStream()) { binaryFormatter.Serialize(memoryStream, value); appUser.Avatar = memoryStream.ToArray(); } a3SContext.Entry(appUser).State = EntityState.Modified; break; } }
public async Task <LdapAuthenticationModeModel> UpdateAsync(LdapAuthenticationModeModel ldapAuthenticationMode) { // Record plain text password and clear from model string password = ldapAuthenticationMode.Password; ldapAuthenticationMode.Password = string.Empty; a3SContext.Entry(ldapAuthenticationMode).State = EntityState.Modified; // Replace Ldap Attribute Links a3SContext.RemoveRange(a3SContext.LdapAuthenticationModeLdapAttribute.Where(x => x.LdapAuthenticationModeId == ldapAuthenticationMode.Id)); await a3SContext.SaveChangesAsync(); // Now store encrypted password await StoreEncryptedPassword(ldapAuthenticationMode.Id, password); return(ldapAuthenticationMode); }
public async override Task SetTokenAsync(UserModel user, string loginProvider, string name, string value, CancellationToken cancellationToken) { bool encrypt = (name == tokenOptions.GetAuthenticatorKeyName()); bool isAutomaticallyVerified = (name == tokenOptions.GetRecoverCodesName()); var tokenEntity = a3SContext.UserToken.SingleOrDefault( l => l.Name == name && l.LoginProvider == loginProvider && l.UserId == user.Id); if (tokenEntity != null) { tokenEntity.Value = (encrypt ? string.Empty : value); if (isAutomaticallyVerified) { tokenEntity.IsVerified = true; } a3SContext.Entry(tokenEntity).State = EntityState.Modified; } else { a3SContext.UserToken.Add(new UserTokenModel { UserId = user.Id, LoginProvider = loginProvider, Name = name, Value = (encrypt ? string.Empty : value), IsVerified = isAutomaticallyVerified }); } await a3SContext.SaveChangesAsync(); if (encrypt) { await StoreEncryptedValue(user, loginProvider, name, value); } }