This list is for problems with FNH, not the C# compiler. For problems like
this I suggest you ask on www.stackoverflow.com

But since its so easy I'll give you this one. The problem is that your
method has to return a value in all cases. Change:

   case "IMS":
        break;

into

   case "IMS":
        return null;

That will fix your compilation error.

On Sun, Sep 26, 2010 at 1:26 AM, adherence <socalledma...@gmail.com> wrote:

> 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<Jinnah.ObjectPersistanceLayer.TPF>
> retval = crit.List<Jinnah.ObjectPersistanceLayer.TPF>();
>                         return  retval;
>                        break;
>                            }
>
>        }
>            }
>        }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to