Hi there,
Can anyone help.
I have the following in vb.net and need to convert it to c#. Seemed rather simple at first but I need to pass in the NamedObject variable as welll which is supported in vb.net but not in c#..
What are my options.
Here is the vb.net - notice the NamedObject
Public Property Datos(ByVal NamedObject As String) As T
Get
Return CType(HttpContext.Current.Session.Item(NamedObject ), T)
End Get
Set(ByVal Value As T)
HttpContext.Current.Session.Item(NamedObject ) = Value
End Set
End Property
and this is c# but it errors as it appears i can't pass in a parameter on a property
public T Datos(string NamedObject)
{
get { return (T)HttpContext.Current.Session[NamedObject]; }
set { HttpContext.Current.Session[NamedObject] = Value; }
}
I would appreciate any input..
Thanks