public async Task Create(TecnologiaLicenciadaPIPIndustrial model) { try { dbGI.DbSetTecnologiaLicenciadaPIPIndustrial.Add(model); await dbGI.SaveChangesAsync(); } catch (Exception e) { throw new Exception(e.Message, e); } }
public async Task <IHttpActionResult> Update([FromBody] TecnologiaLicenciadaPIPIndustrial model) { try { await _repo.Update(model); return(Ok("Registro actualizado exitosamente!")); } catch (Exception e) { return(InternalServerError(e)); } }
public async Task Update(TecnologiaLicenciadaPIPIndustrial model) { try { var _model = await dbGI.DbSetTecnologiaLicenciadaPIPIndustrial.FirstOrDefaultAsync(e => e.Id == model.Id); if (_model != null) { dbGI.Entry(_model).CurrentValues.SetValues(model); await dbGI.SaveChangesAsync(); } } catch (Exception e) { throw new Exception(e.Message, e); } }