我想在通知视图中显示发件人姓名和产品名称

问题描述

public ActionResult ShowNotification()     // showing to user
{
    int currentUserId = (int)Session["CurrentUserId"];
    IEnumerable<ProductOfferModel> productOfferModels = iProductOfferRepo.Getoffer().Where(s => s.SenderId != currentUserId).ToList();  // get all product offer list
    IEnumerable<usermodel> usermodels = iUserRepo.GetUser().ToList(); //get all user model
    return View("~/Views/Home/ShowNotification.cshtml",productOfferModels);
}

enter image description here

enter image description here

enter image description here

解决方法

在您的代码 return View(productOfferModels);

中进行此更改