// GET: PostComms public ActionResult Index() { List <PostCommViewModel> List = new List <PostCommViewModel>(); foreach (var item in Cs.ListPostId()) { PostCommViewModel Cvm = new PostCommViewModel(); Cvm.postId = item.postId; //Cvm.PostCommId = item.PostCommId; Cvm.titre = item.Titre; Cvm.user = item.user; Cvm.datecom = item.datecom; Cvm.imagePath = item.imagePath; //Cvm.titre = item.pos.posttitre; //Cvm.categoryname = item.categoryname; List.Add(Cvm); } return(View(List)); }
public ActionResult postcomm(int id) { var cat1 = Cs.ListPostComm(id); //project List <PostCommViewModel> List = new List <PostCommViewModel>(); foreach (var item in Cs.ListPostComm((int)id)) { PostCommViewModel Pvm = new PostCommViewModel(); Pvm.Commentaire = item.Commentaire; Pvm.user = item.user; Pvm.datecom = item.datecom; Pvm.imagePath = item.imagePath; List.Add(Pvm); } return(View(List)); }