Beispiel #1
0
        public async Task <ICollection <Kweet> > SearchKweetAsync(string find, int from, int to)
        {
            ServiceHelpers.CheckRange(from, to);

            return(await _repository.GetNewestKweetsByQueryAsync(
                       (kweet => kweet.Description.Contains(find)),
                       from,
                       to));
        }
Beispiel #2
0
        public async Task <ICollection <Kweet> > GetAllNewestByUserIdAsync(int userId, int from, int to)
        {
            ServiceHelpers.CheckRange(from, to);

            return(await _repository.GetNewestKweetsByQueryAsync(
                       kweet => kweet.UserId.Equals(userId),
                       from,
                       to));
        }
Beispiel #3
0
        public async Task <ICollection <Kweet> > GetTimeLineForUserIdAsync(int userId, int from, int to)
        {
            ServiceHelpers.CheckValidId(userId);
            ServiceHelpers.CheckRange(from, to);

            return(await _repository.GetNewestKweetsByQueryAsync(
                       (kweet => kweet.UserId.Equals(userId) || kweet.User.Followers.Any(f => f.UserId.Equals(userId))),
                       from,
                       to));
        }
Beispiel #4
0
        public async Task <ICollection <Kweet> > GetAllNewestAsync(int from, int to)
        {
            ServiceHelpers.CheckRange(from, to);

            return(await _repository.GetNewestKweetsAsync(from, to));
        }
Beispiel #5
0
        public async Task <ICollection <ApplicationUser> > GetRange(int from, int to)
        {
            ServiceHelpers.CheckRange(from, to);

            return(await _repository.GetRange(from, to));
        }