Hi here. i am making a little application to help me balance my checkbook. i am using Castle ActiveRecord to map the object properties to the database. now here is the problem. as i am making a money program i made a struct Currency
The struct:
public struct Currency
{
private long amount;
private CurrencyType currencyType;
public long Amount
{
get { return this.amount; }
set { this.amount = value; }
}
public CurrencyType CurrencyType
{
get { return this.currencyType; }
set { this.currencyType = value; }
}
}
The class i am mapping:
[ActiveRecord("[Transaction]")]
public class Transaction: HasOwnerModelBase
{
private Currency amount;
private Category category;
[BelongsTo]
public virtual Category Category
{
get { return this.category; }
set { this.category = value; }
}
public virtual Currency Amount
{
get { return this.amount; }
set { this.amount = value; }
}
}
Now in the ideal situation the Currency object would act like a nested object so the amount and currencyType are two colums in the transaction table. but it is not a nested seeing as i want it to act like the currency struct object.
I have no idea what tag i should give the Currency Amount for it to work, i would really appreciate it if any one could help me solve this problem.
I hope all of this is clear.
Greatings Duncan