Search code examples
c#.netdb4oobject-oriented-database

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?


Solution

  • 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