Re: How to get value of nullable of unknown type??
Tech-Archive recommends: Fix windows errors by optimizing your registry
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: Thu, 11 Oct 2007 05:10:31 -0700
On Oct 11, 6:35 am, h...@xxxxxxxxxx wrote:
I have a situation that I have a nullable type that can be a int?,
double? or any other nullable type. How can I get the contained value
of the nullable without knowing its type.
Just box it, and the result will either be the boxed value, or null.
It's not clear to me what sort of interface you'd be looking to use
for this anyway.
Jon
.
Relevant Pages
- Re: How to get value of nullable of unknown type??
... or any other nullable type. ... of the nullable without knowing its type. ... assigning to a reference of that type. ... (microsoft.public.dotnet.framework) - Re: How to get value of nullable of unknown type??
... or any other nullable type. ... of the nullable without knowing its type. ... If replying to the group, please do not mail me too- Hide quoted text - ... You've been very helpfull allready. ... (microsoft.public.dotnet.framework) - Re: How to get value of nullable of unknown type??
... or any other nullable type. ... of the nullable without knowing its type. ... assigning to a reference of that type. ... (microsoft.public.dotnet.framework) - Re: Why Generics?
... Mike Schilling wrote: ... >> Perhaps you could require a cast before using a nullable type? ... would you like to see some sort of compile-time null ... (comp.lang.java.programmer) - How to get value of nullable of unknown type??
... I have a situation that I have a nullable type that can be a int?, ... I read that in the .NET2.0 beta2 there used to be a INullable ... interface that could be used for this, ... (microsoft.public.dotnet.framework) |
|