Esempio n. 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));
        }
Esempio n. 2
0
 // GET: api/UserTender
 public IEnumerable<UserTenderModel> Get()
 {
     var userTenders = _userTenderService.GetUserTenders();
     return Mapper.Map<IEnumerable<UserTender>, IEnumerable<UserTenderModel>>(userTenders);
 }