public FilterDefinition<IdeaEntity> IdeaFilterQuery(FilterDefinition<IdeaEntity> filter, IdeaFilter ideaFilter)
        {
            if (!String.IsNullOrWhiteSpace(ideaFilter.Username))
            {
                filter = filter & IdeaFilterQuery(ideaFilter);
            }

            return filter;
        }
        public FilterDefinition<IdeaEntity> IdeaFilterQuery(IdeaFilter ideaFilter)
        {
            if (!String.IsNullOrWhiteSpace(ideaFilter.Username))
            {
                var builder = Builders<IdeaEntity>.Filter;

                return builder.Regex(a => a.PostAuthor,
                    BsonRegularExpression.Create(new Regex(ideaFilter.Username.ToLower(), RegexOptions.IgnoreCase)));
            }

            return new BsonDocument();
        }
Example #3
0
 public IdeasByTagResponse(string username)
 {
     IdeaFilter = new IdeaFilter(username);
     Ideas = new IdeaByTagResponse[0];
 }
Example #4
0
 public TagResponse(string username)
 {
     IdeaFilter = new IdeaFilter(username);
     Tags = new IdeaTag[0];
 }