i m trying to learn something in asp net mvc.
i could not handle a problem.
i have a custom class like
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();
}
it s ok with that. but when i want to use this method in controller, the method does not seem.
public ActionResult IndexTrEn()
{
trenMethod. <there is nothing in here> ( i expect that trenMethod.ListAll(); but there is nothing except "Equals, ReferenceEquals" ) }
where i make mistake?
You need to instantiate the class and use the object:
public ActionResult IndexTrEn()
{
var tm = new trenMethod();
tm.ListAll();
...
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments