.NET 2.0 - nullable value types

Posts   
 
    
Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 12-Aug-2005 15:49:17   

I was dumbfounded to find out this morning that .NET 2.0 CLR supports nullable value types. See http://msdn.microsoft.com/vcsharp/2005/overview/language/nullabletypes/ for more info.

Do you plan in the 2.0 release of LLBLGen Pro to support nullable properties this way?

It would be so cool to be able to have a business entity with nullable value types, like this (I'll represent everything as fields for brevity):

class Person { int ID; string LastName; string FirstName; DateTime? Birthday; int? FavoriteNumber; }

Then, in code, I could do this:

PersonEntity p = new PersonEntity(123); p.LastName = "Bouma"; p.FirstName = "Frans"; p.Birthday = null; p.FavoriteNumber = null;

Of course, I'd be getting the values from a control, but you get the idea. Is this in the works for v2.0?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 13-Aug-2005 10:54:31   

Nullable types are definitely going to be supported in llbglen pro 2.0. I'm not yet sure which way I'll pick: Nullable<int> or int? etc.

It should be possible to have nullable types in 1.0.2005.1 as well though, through custom converters for .NET types (and for .NET 1.x). Though more on that when 1.0.2005.1 is in beta simple_smile

Frans Bouma | Lead developer LLBLGen Pro
cjendro avatar
cjendro
User
Posts: 15
Joined: 25-Dec-2005
# Posted on: 30-Dec-2005 16:10:56   

Otis wrote:

Nullable types are definitely going to be supported in llbglen pro 2.0. I'm not yet sure which way I'll pick: Nullable<int> or int? etc.

It should be possible to have nullable types in 1.0.2005.1 as well though, through custom converters for .NET types (and for .NET 1.x). Though more on that when 1.0.2005.1 is in beta simple_smile

Any infos about Nullable Types?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 02-Jan-2006 10:42:05   

cjendro wrote:

Otis wrote:

Nullable types are definitely going to be supported in llbglen pro 2.0. I'm not yet sure which way I'll pick: Nullable<int> or int? etc.

It should be possible to have nullable types in 1.0.2005.1 as well though, through custom converters for .NET types (and for .NET 1.x). Though more on that when 1.0.2005.1 is in beta simple_smile

Any infos about Nullable Types?

Nothing more than that you can implement them in .NET 2.0 using a type converter but on .NET 1.x it's not that useful, even with nullable type libraries. the problem is with PK - FK syncing, where the PK is a normal int and hte FK is a nullableint. After syncing the FK is a normal int, and not a nullableint.

Frans Bouma | Lead developer LLBLGen Pro