C# Mapping struct in ActiveRecord -
I'm applying a little bit to help balance my checkbook. I am using Castle Actocarcord to map object properties to the database. Now there is a problem as I am making a money program. I have created a structure.
Structure:
public structure currency {private long amount; Private currency type currency; Public long amount {come back} } Set {this.amount = value; }} Public Transcript Printer {Get {return.currencyType; } Set {this.currencyType = value; Class I: The mapping is: [ActiveRecord ("[transaction]")] Public class transactions: HasOwnerModelBase {Private currency amount; Private Category Category; [Belges] Public virtual category category {get this categorized; } Set {this.category = value; }} Public virtual currency amount {receive {this.mount; } Set {this.amount = value; }}}
Now in the ideal case, the currency object will act as a nested object so that the amount and type the currency, there are two colums in the transaction table. But it does not look nested because I want to work it like currency structure.
I do not know that for this I should give the amount of money, I really appreciate it if any
Grant Duncan
What about the following? Or did not I get the question? Note that I have changed the structure into a class because you are required by virtual members for dynamic proxy generation and you can not keep virtual members on the structures. By the way, why do not you use the automatically applied properties?
public class currency {[property] public virtual int64 amount {get; Set; } [Property] Public virtual currency type currency type {receive; Set; }} [ActiveRecord ("[transaction]")] Public class transaction: HasOwnerModelBase {[BelongsTo] Public Virtual Category Category {Received; Set; } [Nested] public virtual currency amount {get; Set; }}
Comments
Post a Comment