im asp net mvc에서 무언가를 배우려고합니다.
나는 문제를 처리 할 수 없었다.
나는 같은 맞춤 수업이 있습니다
public class trenMethod
{
public testDBContex db;
public List<IsSoSu> ListAll()
{
var Name= from a in db.test1
from b in db.test2
where a.Name== b.Name
select new IsSoSu()
{
NameLast=a.Name,
MidNameLast=a.MidName,
SurnameLast=b.Surname
};
return Name.ToList();
}
괜찮습니다. 하지만 컨트롤러 에서이 방법을 사용하고 싶을 때 방법이 보이지 않습니다.
public ActionResult IndexTrEn()
{
trenMethod. <there is nothing in here> ( i expect that trenMethod.ListAll(); but there is nothing except "Equals, ReferenceEquals" ) }
내가 실수 한 곳은?
클래스를 인스턴스화하고 객체를 사용해야합니다.
public ActionResult IndexTrEn()
{
var tm = new trenMethod();
tm.ListAll();
...
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다