Exemple #1
0
        public ActionResult Details(int id)
        {
            var work = workRepository.GetByID(id);

            if (work == null)
            {
                return(HttpNotFound());
            }

            var workviewmodel = new WorkViewModel
            {
                Work        = work,
                WorkComment = new WorkComment()
                {
                    WorkId = work.WorkId
                },
                Offer = new Offer()
                {
                    WorkId = work.WorkId
                }
            };

            workviewmodel.Work.Offers.Reverse();
            workviewmodel.Work.Comments.Reverse();

            return(View(workviewmodel));
        }