Switch has a default:(switch) which is used for otherwise so if not
IMS or TPF what then ???

On 26 sep, 14:56, Diego Mijelshon <[email protected]> wrote:
> That's a C# error, not 
> NH.http://msdn.microsoft.com/en-us/library/06tc147t(v=VS.100).aspx
>
>     Diego
>
>
>
> On Sun, Sep 26, 2010 at 04:39, adherence <[email protected]> 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
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<nhusers%[email protected] 
> > >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to