Ejemplo n.º 1
0
        public virtual void RemoveJobOffersThatDoesNotMeetMinimalWage(decimal minimalWage, int countryID)
        {
            var offers = jobOfferRepository.GetJobOffersWithoutMinimalWage(minimalWage, countryID);

            var offersByCompanies = offers.GroupBy(o => o.CompanyID);


            using (NoSaveChanges)
            {
                foreach (var offer in offersByCompanies)
                {
                    InformCompanyAboutOfferRemovedDueToMinimalWage(offer.First(), offer.Count());
                }

                foreach (var offer in offers)
                {
                    jobOfferRepository.Remove(offer);
                }
            }

            jobOfferRepository.SaveChanges();
        }