Empty string handling

Posts   
 
    
ITFromBit
User
Posts: 8
Joined: 19-Feb-2021
# Posted on: 14-Jan-2022 15:08:02   

There is one thing that I do not understand: I do have a nvarchar(50) field, optional or required - it does not matter. Now, when I intantiate a new object of that entity the string properties are set to empty string and not to null. So if I save the entity (entity.SaveEntity(entity,true) I end up having empty strings in the database where I shoudl excpect to have null values. What I am doing wrong here?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 14-Jan-2022 18:03:48   

There is a setting for it in the Designer. Go to Project Setting/Conventions/Entity Model/LLBLGen Pro Runtime Framework

There under General you should find Convert null reference types to default value. Un-check it, or set it to false, to get null values instead of the default type value.

ITFromBit
User
Posts: 8
Joined: 19-Feb-2021
# Posted on: 14-Jan-2022 18:27:43   

Many thanks! That quite settles it.