LLBLGen 5.4.3
I have a column in my database, which is an nvarchar(MAX) called DerivedFrom. It's NOT NULL and therefor never has any null values.
When I fetch my entity, the DerivedFrom property is NULL. I'd expect it to be an empty string. Why is this?
Basically it's causing me an issue with some automated property mapping I'm doing, because the mapping code thinks that the value has changed vs the source data. So the source data has an empty string, but the entity has a null. It sets the value back to string.Empty and sees it as a change. Any changes detected have a further set of processing on them, so it's causing a bit of an issue.
For the time being I've just checked if the target property is a string and made my code set the value anyway and ignore it as a change. If I don't set the property, then any new entities fail to save, because I've not set a value to the property so LLBLGen doesn't set a value so it throws an exception as you'd expect:
Cannot insert the value NULL into column 'DerivedFrom', table 'RP2.15.dbo.RP_SpecificationComposite'; column does not allow nulls. INSERT fails.
The statement has been terminated.