All,

I have the a Money "value type" which has a CurrencyObj "entity" as a property:

public class Money
{
public readonly CurrencyObj Currency{ get; set; }
public readonly decimal Amount{ get; set; }

public Money(CurrencyObj currency, decimal amount)
{
this.Currency = currency;
this.Amount = amount;
}
}

public class CurrencyObj
{
public readonly int Id;

public readonly string IsoAlphaCode { get; set; }

public readonly string Name { get; set; }


public Currency(int id, string isoAlphaCode, string name)
{
this.Id = id;
this.IsoAlphaCode = isoAlphaCode;
this.Name = name;
}
}

The Money.Amount property values is in one table whereas the Money.Currency property values are in another.

I want to be able to map the Money value type using the constructor with arguments. Can this be done using ICompositeUserType - Im thinking not as all values would need to be in the same table?
Is there another way?

Cheers
Billy Stack

--
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to