public MedicationModel Post(MedicationModel model)
 {
     if (!dbContext.Cabinets.Any(u => u.Id == model.CabinetId))
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
     var medication = model.ToDbMedication();
     dbContext.Add(medication);
     dbContext.Commit();
     return Get(medication.Id);
 }
 public MedicationModel Put(MedicationModel model)
 {
     var medication = dbContext.Medications.FirstOrDefault(m => m.Id == model.Id);
     if (medication == null)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
     model.UpdateDbMedication(medication);
     dbContext.Commit();
     return Get(model.Id);
 }