I have a Currency object and a Product object. I need to link the Currency to WholesaeCurrency as well as RetailCurrency fields of the Product object
public class Currency
{
/// <summary>
/// Id is the 3 character ISO currency code
/// </summary>
[StringLength(3)]
public string Id { get; set; }
[StringLength(100)]
public string Name { get; set; }
}
I have another object with 2 currency fields:
public class Product
{
public int Id { get; set; }
public decimal WholesaleRate { get; set; }
public string WholesaleCurrencyId { get; set; }
public virtual Currency WholesaleCurrency { get; set; }
public decimal RetailRate { get; set; }
public string RetailCurrencyId { get; set; }
public virtual Currency RetailCurrency { get; set; }
}
My queries are:
- What is the relation between these 2 objects? one-to-many or one-to-one?
- How do I express these relations? Is the above correct?
