چگونه به view یک تابع ilist ftvsjl

سوال

در کنترلر:

public IList GetCompanyByidScope()
{
CompanyEntities db = new CompanyEntities();
int id = (int)(TempData[“td-idScope”]);

var result = (from c in DataBase.dbEntity.Company_T
join ss in DataBase.dbEntity.Scope_T
on c.idScope equals ss.idScope
where c.idScope == id
select new {c.idCompany,c.idScope,c.idWebStore,c.logoCompany,
c.mobileAdministrator,c.nameCompany,c.phoneCompany,
c.webSiteAddressCompany,c.addressCompany,c.administratorCompany,
c.emailCompany,c.establishedYearCompany ,ss.nameScope,ss.descriptScope }).ToList();

TempData[“td-idScope”] = result;

return result;

}

در view:

Html.Action(“GetCompanyByidScope”, “Home”);

IList co = (IList)(TempData[“td-idScope”]);

0
mortezatot 2 ماه 0 پاسخ ها 30 دیده شده 0

ارسال یک پاسخ