public List <Campaign> GetAll(CampaignFilterOptions options = null)
        {
            var query = Context.Campaign.Where(c => !c.Deleted.HasValue);

            if (options != null)
            {
                if (!string.IsNullOrEmpty(options.SearchTerm))
                {
                    query = query.Where(x => (!string.IsNullOrEmpty(x.Name) && x.Name.Contains(options.SearchTerm)) ||
                                        (!string.IsNullOrEmpty(x.Description) && x.Description.Contains(options.SearchTerm)));
                }
            }

            return(query.ToList());
        }
Exemple #2
0
 public List <Campaign> GetAll(CampaignFilterOptions options = null)
 {
     return(Repository.GetAll());
 }