Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 public LocalisationService(ILocalisationRepository localisationRepository) => _localisationRepository = localisationRepository;