public static void GetOffer(int id, int offerId, out Offer offer, ILocalisationRepository lRepo, IOfferRepository oRepo, Func<ActionResult> caseError) { //case no offer selected, take the first one if (offerId == 0) { var loc = lRepo.Get(id); offer = loc.Offers.FirstOrDefault(); if (offer == null) { caseError.Invoke(); } } else { offer = oRepo.Get(offerId); } }
public LocalisationService(ILocalisationRepository localisationRepository) => _localisationRepository = localisationRepository;