Esempio n. 1
0
        public void Delete(int id)
        {
            AnimalVaccination vaccineToDelete = _db.AnimalVaccinations.FirstOrDefault(entry => entry.AnimalVaccinationId == id);

            _db.AnimalVaccinations.Remove(vaccineToDelete);
            _db.SaveChanges();
        }
Esempio n. 2
0
 public void Put(int id, [FromBody] AnimalVaccination animalVaccination)
 {
     animalVaccination.AnimalVaccinationId = id;
     _db.Entry(animalVaccination).State    = EntityState.Modified;
     _db.SaveChanges();
 }
Esempio n. 3
0
 public void Post([FromBody] AnimalVaccination animalVaccination)
 {
     _db.AnimalVaccinations.Add(animalVaccination);
     _db.SaveChanges();
 }