サードパーティからリスト付きのオブジェクトを取得しているため、コンストラクターを設定できません。2つのActionResultがあります。1つはサードパーティからオブジェクトを取得し、もう1つはjqueryオートコンプリートによって使用されます。
リストを設定して、次のActionResultでnullにならないようにする方法がわかりません...
public class MyController : Controller
{
public List<T> myList;
public ActionResult CallToGetThirdPartList(ThirdPartyObject obj)
{
list = obj.SpecialList;
return View(obj); //important
}
public ActionResult Search(ThirdPartyObject obj) //gets called from jquery
{
var results = from m in myListist //this is null
where m.Title.StartsWith(term)
select new { label = m.Summary, m.id };
return Json(results, JsonRequestBehavior.AllowGet)
}
}