Esempio n. 1
0
        public void RemoveArea(int id)
        {
            var area = _areaRepository.Get(id);;

            if (area == null)
            {
                throw new NullReferenceException("Area does not exist!");
            }

            var activeBenefits = _benefitRepository.GetActive(area.Id).Count;

            if (activeBenefits != 0)
            {
                new Exception("Active programs present.");
            }
            _benefitRepository.DeleteAll(area.Id);
            _areaRepository.Delete(id, area);
        }