public async Task <IActionResult> UpdateSpecialties_Vets(long id, Specialties_VetsModel specialties_vets) { try { if (id != specialties_vets.IdSpecialties_Vets) { return(BadRequest()); } else { dBContext.Entry(specialties_vets).State = EntityState.Modified; await dBContext.SaveChangesAsync(); return(NoContent()); } } catch (Exception e) { bool existSpecialties_vets = dBContext.Specialties_Vets.Any(e => e.IdSpecialties_Vets == id); if (!existSpecialties_vets) { return(NotFound()); } else { return(StatusCode(410)); } } }
public async Task <ActionResult <Specialties_VetsModel> > CreateSpecialties_Vets(Specialties_VetsModel specialties_vets) { try { dBContext.Specialties_Vets.Add(specialties_vets); await dBContext.SaveChangesAsync(); return(Ok(specialties_vets)); } catch (Exception e) { return(StatusCode(410)); } }