tags:

views:

74

answers:

1

Hi,

I have a calculated property in my object that I don't want to save to the DB, is there a way I can specify that?

Like this one as an exemple :

public virtual string FullInfos
    {
        get
        {
            var html = Contact1Info;
            html += Contact2Info;
            return html;
        }
    }

Where Contact1Info and Contact2Info are automatic property already saved...

Thanks!

+1  A: 

NoRM provides a series of attributes. In this case you're looking for the [MongoIgnore] attribute.

Should be as simple as

[MongoIgnore]
public virtual string FullInfos
    {
        get
        {
            var html = Contact1Info;
            html += Contact2Info;
            return html;
        }
    }
Gates VP
Thanks, do you know if there is any documentation about NoRM? I was looking on the net but did'nt found anything.
VinnyG
NoRM code is here, but I'm sure you know that:http://github.com/atheken/NoRMThe Google Group is here:http://groups.google.com/group/norm-mongodbNoRM is still a small-scale project, so I strongly suspect that you'll do best on the mailing list and taking a look at some of the code.
Gates VP
The unit tests are the best documentation of norm.
TTT