views:

55

answers:

1

I'm creating an object that will be used to store 'known quantities' or facts. Ideally, it'd look something like:

public class KnownQuantity<T> 
{
    public T Quantity { get; set; }

    public KnownQuantity(T quantity)
    {
        this.Quantity = quantity;
    }
}

However, this class is to become a persistent object. Currently I'm using DevExpress XPO, but the ORM isn't set in stone if another one will support this kind of usage.

How would I go about something like this?

A: 

DataObjects.Net supports automatic registration (~= automatic mapping) of generic instances in cases like this, if you'd set a constraint for T.

See an example model with open generics for it.

Alex Yakunin