Answer Question
Nhibernate With Switch
Hey Everyone..
i need to return the Ilist corresponding to the cases.
i have a problem in switch.
1- when i m Returning a value , it gives error ("Not all paths return a value")
and
2- when i put return outside the switch block or outside the case ,it gives error ("the retval doesnt exist in the current
context")
please help ..
public object GetAll(object _oplObj)
{
using (NHibernate.ISession session = OpenSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
ICriteria crit = session.CreateCriteria(_oplObj.GetType());
switch (_oplObj.GetType().ToString())
{
case "IMS":
break;
case "TPF":
IList retval = crit.List();
return retval;
break;
}
}
}
}
TEXT
Uploading file and scanning for virus...
Please Wait