public async Task <IAddressResult> Update(IAddressResultUpdate update) { if (update is null) { throw new ArgumentNullException(nameof(update)); } var entity = await context.AddressResults.FirstOrDefaultAsync(f => f.Id == update.Id); if (entity != null) { PatchProperties(entity, update); context.AddressResults.Update(entity); await context.SaveChangesAsync(); } return(entity); }
private void PatchProperties(AddressResult entity, IAddressResultUpdate update) { entity.Latitude = update.Latitude; entity.Longitude = update.Longitude; entity.State = State.Terminado; }