开发者

Subsonic SimpleRepository Nullable string problem

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 开发者_Go百科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?


Add the [SubSonicNullString] attribute.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜