IsNullable and (.NET 2.0) Generate as Nullable Designer Checkbox

Posts   
 
    
Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 29-Feb-2008 13:17:12   

I am generating code using C# templates as follows:


if (field.DotNetType.IsValueType && field.IsNullable)
{
    return "Nullable<" + field.DotNetType.Name + ">";
} else {
    return field.DotNetType.Name;
}

Where "field" is of type EntityFieldDefinition.

But field.IsNullable = true even when the designer checkbox "Generate as Nullable type" is unchecked. Is there another field which qualifies this property according the designer checkbox value?

I am using LLBLGen Pro 2.0.0.0 Final (March 21st 2007).

Marcus

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 29-Feb-2008 15:24:21   

What about field.GenerateAsNullableOfT?

Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 29-Feb-2008 15:27:05   

Walaa wrote:

What about field.GenerateAsNullableOfT?

Walaa - THANK YOU!

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 29-Feb-2008 15:39:11   

You're mostly welcomed simple_smile