tengo problemas con el siguiente método.
public async Task<string> EditUsuario(
string id,
string userName,
string email,
string phoneNumber,
int accessFailedCount,
string concurrencyStamp,
bool emailConfirmed,
bool lockoutEnabled,
DateTimeOffset lockoutEnd,
string normalizedEmail,
string normalizedUserName,
string passwordHash,
bool phoneNumberConfirmed,
string securityStamp,
bool twoFactorEnabled,
ApplicationUser applicationUser
)
{
var resp = "";
try
{
applicationUser = new ApplicationUser
{
Id = id,
UserName = userName,
Email = email,
PhoneNumber = phoneNumber,
EmailConfirmed = emailConfirmed,
LockoutEnabled = lockoutEnabled,
LockoutEnd = lockoutEnd,
NormalizedEmail = normalizedEmail,
NormalizedUserName = normalizedUserName,
PasswordHash = passwordHash,
PhoneNumberConfirmed = phoneNumberConfirmed,
SecurityStamp = securityStamp,
TwoFactorEnabled = twoFactorEnabled,
AccessFailedCount = accessFailedCount,
ConcurrencyStamp = concurrencyStamp
};
//Actualizamos los datos
_context.Update(applicationUser);
await _context.SaveChangesAsync();
resp = "Save";
}
catch
{
resp = "No Save";
}
return resp;
}
Debería actualizar los datos, pero resp siempre me devuelve "No Save". No tengo ni idea de qué está fallando exactamente. ¿Alguien sabría decirme?
Un saludo y gracias