Exemple #1
0
        public List <Feed> GetFeedByDate(DateTime from, DateTime to, Guid userId)
        {
            var query = new SqlQuery("events_feed")
                        .Select("Id", "FeedType", "Caption", "Date", "Creator", "true")
                        .Where(Exp.Between("Date", from, to) & Exp.Eq("Tenant", tenant))
                        .OrderBy("Date", true);

            return(dbManager.ExecuteList(query).Select(x => Mappers.ToFeed(x)).ToList());
        }
Exemple #2
0
        public List <Feed> SearchFeeds(string s, FeedType feedType, Guid userId, int count, int offset)
        {
            if (s != null && s.Length < MinSearchLength)
            {
                return(new List <Feed>());
            }

            var select = Query("events_feed")
                         .Select("Id", "FeedType", "Caption", "Date", "Creator")
                         .Select(GetFeedReadedQuery())
                         .Where(GetWhere(s, feedType, userId))
                         .OrderBy("Id", false)
                         .SetFirstResult(offset)
                         .SetMaxResults(count);

            return(dbManager
                   .ExecuteList(select)
                   .ConvertAll(r => Mappers.ToFeed(r)));
        }