public void Delete(ProviderEducation entity) { var data = (from proEdu in _context.ProviderEducations where proEdu.ProviderId == entity.ProviderId && proEdu.DegreeTitle == entity.DegreeTitle && proEdu.SchoolTitle == entity.SchoolTitle select proEdu).FirstOrDefault(); if (data != null) { _context.ProviderEducations.Remove(data); } else { throw new Exception("Education does not exist."); } }
public void AddProviderEducation(ProviderEducation entity) { var education = (from proEdu in _context.ProviderEducations where proEdu.ProviderId == entity.ProviderId && proEdu.DegreeTitle == entity.DegreeTitle && proEdu.SchoolTitle == entity.SchoolTitle select proEdu).FirstOrDefault(); if (education == null) { _context.ProviderEducations.Add(entity); } else { throw new Exception("Education already added"); } }
public void Save(ProviderEducation entity) { _context.ProviderEducations.Add(entity); }