|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
C# keyword default(T) to VB.netI can not find the answer for this anywhere. What is the keyword in VB.net
that matches the default(T) generics keywork in vb.net? C# return ID == null || ID.Equals(default(IdT)); vb.net Return ((ID Is Nothing) Or ID.Equals(default(idt))) default expects and expression. Thanks. "Eric Cathell" <depictureboy@community.nospam> schrieb: 'Nothing'.>I can not find the answer for this anywhere. What is the keyword in VB.net >that matches the default(T) generics keywork in vb.net? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Eric,
As Herfried stated, its "Nothing" | C# Return ((ID Is Nothing) Or ID.Equals(Nothing))| return ID == null || ID.Equals(default(IdT)); | | vb.net NOTE: The above assumes that you have an IEquatable constraint on ID! If you don't have the constraint, I would define a temporary variable & pass that: Dim [default] As idt Return ((ID Is Nothing) Or ID.Equals([default])) Which implies you could write a generic method: Public Function [Default](Of T)() As T Return Nothing End Function Return ((ID Is Nothing) Or ID.Equals([Default](Of idt)())) -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Eric Cathell" <depictureboy@community.nospam> wrote in message news:u%236$aAfzGHA.2076@TK2MSFTNGP04.phx.gbl... |I can not find the answer for this anywhere. What is the keyword in VB.net | that matches the default(T) generics keywork in vb.net? | | C# | return ID == null || ID.Equals(default(IdT)); | | vb.net | Return ((ID Is Nothing) Or ID.Equals(default(idt))) | | default expects and expression. | | Thanks. | |
For Next Loop - Manual Might Be Wrong
"If" statement asking for integer Is Thread.Abort() blocking until Thread has exited? Stream Application quit after button click Appending text to an array of textboxes Strange Datagrid Behavior How to use Resource files in VS 2005? EventType clr20r3 system.io.filenotfoundexception What can I use instead of "picture box"? |
|||||||||||||||||||||||