views:

98

answers:

1

Hi

I am having a problem with subsonic simplerepository. I have a users class and it has some optional fields.these optional fields are of type string. As soon as I try to persist my object , if the optional fields are null , an exception is being thrown

I know string is already of type nullable so i cannot do something like nullable and string? so what should i do in this case ?

Another option that I have at this point of time is , before persisting the object, check if the optional attributes are null if they are null, assign them some dummy data. for example "abracadabra". now whenever i am populating the objects back from the database i check if optional attributes have this value. if they have this value I make the optional attributes empty in my class.

ah! one more thing, please ! can i use ActiveRecord for winforms?

A: 

Add the [SubSonicNullString] attribute.

Jeremy H