public async Task <CorpClient> Update(UpdateCorpClient model) { var entity = context.CorpClients.Find(model.CorpClientId); entity.DBAName = model.DbaName; entity.Currency = model.Currency; entity.Name = model.Name; entity.CustomerTypeId = model.CustomerTypeId; entity.Mobile = model.Mobile; entity.Email = model.Email; if (model.CustomerTypeId == 1) { entity.CPF = model.SocialIdentifier; entity.CNPJ = null; } else { entity.CNPJ = model.SocialIdentifier; entity.CPF = null; } context.Update(entity); var rows = await context.SaveChangesAsync(); return(mapper.Map <CorpClient>(entity)); }
public async Task <ActionResult <CorpClient> > Update(UpdateCorpClient model) { var data = await service.Update(model); if (data != null) { return(Ok(data)); } return(new StatusCodeResult(304)); }
public async Task <CorpClient> Update(UpdateCorpClient model) { return(await corpClientRepository.Update(model)); }
public async Task <CorpClient> Update(UpdateCorpClient model) { return(await corpClientApp.Update(model)); }