public static bool NeedsToBeNotified(int idDon) { CerereService service = new CerereService(); foreach (var i in service.GetNotificari()) { if (i.id_donator == idDon) { //de ce delete? //service.DeleteNotificare(idDon); return(true); } } return(false); }
public void DeleteNotificare(int idDonator) { CerereService service = new CerereService(); var notificari = service.GetNotificari(); foreach (var i in notificari) { if (i.id_donator == idDonator) { using (UnitOfWork unitOfWork = new UnitOfWork()) { unitOfWork.NotificariRepo.Delete(i); unitOfWork.Save(); } } } }