public async Task <string> PutNativeCity(NativeCity nativeCity) { _context.Entry(nativeCity).State = EntityState.Modified; await _context.SaveChangesAsync(); return(string.Empty); }
public async Task <Response> PutCitizen(Citizen citizen) { NativeCity nativeCity = await _context.NativeCity.FirstOrDefaultAsync(q => q.Id == citizen.IdNativeCity); if (nativeCity == null) { return(new Response { Message = "The Native City does not exists" }); } citizen.NativeCity = nativeCity; _context.Entry(citizen).State = EntityState.Modified; await _context.SaveChangesAsync(); return(new Response { Message = "Information modified sucefully" }); }