Search code examples
c#.netwinforms.net-3.5db4o

db4o - ignore specific class property


Is there a way (meta property maybe) to tell db4o to simply ignore a specific property of a class?

I can't see anywhere to do that..

For my purpose I have a bunch of data entity that i need to persist now and then. I also sometimes need to hold a ref to a UI element associated with it, but I don't want db4o to persist that element when I update the object.

I can go around it by backing up, nulling the ref, saving, and finally restoring the reference but it seems really bad.

Anyway I can tell db4o to ignore it altogether?


Solution

  • You can add the Transient attribute to the specific field (db4o knowns nothing about properties)

    public class Test
    {
        [Transient] private string name;
        // ...
    }
    

    Best