Agree with that. Observation comes from that the documentation implies that it is already a session object and thus the cast shouldn't be needed. For an object like session that tends to get used frequently, in my mind it is kind of like requiring an int to be cast to an int before using it.
--- In vantage@yahoogroups.com, John Driggers <waffqle@...> wrote:
>
> It's mostly a design decision. C# is a strongly typed language. VB is more
> akin to a weakly typed language.
> The core reason that you have to cast manually in C# is that it doesn't do
> Type Coercion.
> If VB is expecting an int/session/etc and you feed it something else, it
> will try to cast before failing. C# on the other hand will complain as soon
> as it realizes the types don't match.
>
> On Wed, Feb 8, 2012 at 3:39 PM, jckinneman <jckinneman@...> wrote:
>
> > **
> >
> >
> > In C# you need to cast it to session object. Why C# is different than VB
> > in that you can't use it directly don't know.
> >
> > Epicor.Mfg.Core.Session Session = (Epicor.Mfg.Core.Session)
> > CustomerEntryForm.Session;
> >
> > xxxxx = Session.UserID;
> >
> > Jim Kinneman
> > Encompass Solutions, Inc
> >
> >
> > --- In vantage@yahoogroups.com, "Anon" <jgiese@> wrote:
> > >
> > > view.dataView(args.Row)("ShortChar01") =
> > CustomerEntryForm.Session.UserID;
> > >
> > > I am trying to get the above VB line to work in c#. Converting it to:
> > >
> > > view.dataView[args.Row]["ShortChar01"] =
> > CustomerEntryForm.Session.UserID;
> > >
> > > yields an 'object' does not contain a definition for 'UserID' error. How
> > do I need to reference this?
> > >
> >
> >
> >
>
>
>
> --
> *John Driggers*
> *High End Dev, System Design, Profit Drinking
> *
> *:: 904.962.2887*
> *:: waffqle@...*
> *:: NO FAXES*
>
> *
>
> *
>
>
> [Non-text portions of this message have been removed]
>