// PUT api/<controller>/5 public async void Put(int id, [FromBody] EmpresaContato value) { try { await _empresaContatoAppService.Update(value); } catch (Exception ex) { throw new Exception(ex.Message); } }
// DELETE api/<controller>/5 public async void Delete(EmpresaContato value) { try { await _empresaContatoAppService.RemovePhysical(value); } catch (Exception ex) { throw new Exception(ex.Message); } }
// POST api/<controller> public async void Post([FromBody] EmpresaContato value) { try { await _empresaContatoAppService.Add(value); } catch (Exception ex) { throw new Exception(ex.Message); } }
public LojaContatoViewModel(EmpresaContato lojaContato) { Id = lojaContato?.Id ?? 0; DataInsercao = lojaContato?.DataInsercao ?? DateTime.Now; Contato = new ContatoViewModel(lojaContato?.Contato); }