Example #1
0
        public ActionResult GetTopNForUser(int n, int userID)
        {
            var tenders = _userTenderService.GetUserTenders()
                          .Where(ut => ut.User.UserId == userID)
                          .Select(ut => ut.Tender)
                          .OrderByDescending(t => t.TenderId)
                          .Take(n);

            return(ReturnProjects(tenders));
        }
 // GET: api/UserTender
 public IEnumerable<UserTenderModel> Get()
 {
     var userTenders = _userTenderService.GetUserTenders();
     return Mapper.Map<IEnumerable<UserTender>, IEnumerable<UserTenderModel>>(userTenders);
 }