public ICampaign Resolve(CampaignTypes campaignType) { var campaign = _campaigns.FirstOrDefault(p => p.CampaignTypes == campaignType); if (campaign is null) { throw new ArgumentNullException(nameof(campaignType)); } return(campaign); }
public ICampaign Get(Category.Category category, double campaignValue, int minProductQuantity, CampaignTypes campaignTypes) { ICampaign campaign = null; switch (campaignTypes) { case CampaignTypes.Amount: campaign = new AmountCampaign(category, campaignValue, minProductQuantity); break; case CampaignTypes.Rate: campaign = new RateCampaign(category, campaignValue, minProductQuantity); break; } return(campaign); }
public IQueryable <CampaignType> GetCampaignTypes() => CampaignTypes.AsNoTracking();