фикшу баги

This commit is contained in:
gg12 darfren 2024-04-27 17:27:47 +04:00
parent ea42dc9fc4
commit f6c25cf968

View File

@ -80,8 +80,11 @@ namespace VetClinicDataBaseImplement.Models
if (medicineAnimals != null && medicineAnimals.Count > 0)
{
context.MedicineAnimals.RemoveRange(medicineAnimals.Where(rec
=> !model.MedicineAnimals.ContainsKey(rec.MedicineId)));
=> !model.MedicineAnimals.ContainsKey(rec.AnimalId)));
foreach (var animal in medicineAnimals)
{
model.MedicineAnimals.Remove(animal.AnimalId);
}
context.SaveChanges();
}
var medicine = context.Medicines.First(x => x.Id == Id);