Ejemplo n.º 1
0
        public AllCommentVm GetAllComents(int Id)
        {
            DeskComputers deskComputer = Context.Items.OfType <DeskComputers>().FirstOrDefault(desk => desk.Id == Id);


            IEnumerable <Comment> comments = deskComputer.Comments;

            IEnumerable <CommentVm> allCommentsVM = Mapper.Map <IEnumerable <Comment>, IEnumerable <CommentVm> >(comments);

            AllCommentVm vm = new AllCommentVm()
            {
                AllComments = allCommentsVM
            };


            return(vm);
        }
Ejemplo n.º 2
0
        public AllCommentVm GetAllComents(int Id)
        {
            Notebooks notebooks = Context.Items.OfType <Notebooks>().FirstOrDefault(desk => desk.Id == Id);


            IEnumerable <Comment> comments = notebooks.Comments;

            IEnumerable <CommentVm> allCommentsVM = Mapper.Map <IEnumerable <Comment>, IEnumerable <CommentVm> >(comments);

            AllCommentVm vm = new AllCommentVm()
            {
                AllComments = allCommentsVM
            };


            return(vm);
        }
Ejemplo n.º 3
0
        public ActionResult AllComments(int Id)
        {
            AllCommentVm vm = service.GetAllComents(Id);

            return(this.PartialView("_AllCommentsPartial", vm));
        }