Cybersilent
یک شنبه 19 خرداد 1392, 12:35 عصر
به نظر دوستان مشکل کد زیر چیه؟
public ActionResult ShowLinkSubLink(Guid id)
{
Link link = db.Links.FirstOrDefault(x => x.Id == id);
Guid cityId = (TempData["cityId"] != null ? new Guid(TempData["cityId"].ToString()) : new Guid("70044cdc-4d4a-432d-89a7-3c48936f2649"));
IEnumerable<Link> links =
db.Links.Where(
x => (x.Type == (link == null ? 1 : 2) || x.Type == (link == null ? 1 : 3)) && (x.OwnerLink == null || x.OwnerLink.Id == id) && x.City.Id == cityId).
OrderBy(y => y.Subject);
return View("Index", links);
}
هر وقت برنامه رو اجرا می کنم این پیغام خدا رو میده :
Unable to create a constant value of type 'BookLibrary.Models.DataBase.Link'. Only primitive types or enumeration types are supported in this context.
public ActionResult ShowLinkSubLink(Guid id)
{
Link link = db.Links.FirstOrDefault(x => x.Id == id);
Guid cityId = (TempData["cityId"] != null ? new Guid(TempData["cityId"].ToString()) : new Guid("70044cdc-4d4a-432d-89a7-3c48936f2649"));
IEnumerable<Link> links =
db.Links.Where(
x => (x.Type == (link == null ? 1 : 2) || x.Type == (link == null ? 1 : 3)) && (x.OwnerLink == null || x.OwnerLink.Id == id) && x.City.Id == cityId).
OrderBy(y => y.Subject);
return View("Index", links);
}
هر وقت برنامه رو اجرا می کنم این پیغام خدا رو میده :
Unable to create a constant value of type 'BookLibrary.Models.DataBase.Link'. Only primitive types or enumeration types are supported in this context.