开发者

How do you exclude a property in a persistent object in db4o using C#?

Since "[Transient]" does not开发者_运维百科 really work on properties. What do I do now?


db4o doesn't care about properties. It cares about fields.

I guess you are trying to use "auto-implemented properties", correct?

Until we improve db4o to fully understand auto-implemented properties my best bet is to use normal properties for such cases.

[edited]

class Item
{
    [Transient] 
    private int serviceLength; 

    public int ServiceLength
    {
       get { return serviceLength; } 
       set { serviceLength = value; } 
    }
}

[/edited]

We do have an open issue to add support for automatic properties. If that's important for you, please, vote on it.

Best

Adriano

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜