I am looking to create Currency
and CrossRates
in Entity Framework.
From a SQL perspective the CrossRates
table would be quite simple.
Date |FromCurrency|ToCurrency|Rate 01/01/2000|USD |EUR |1.5 01/01/2000|EUR |USD |0.67
How do I take the above idea and apply it within Entity Framework?
Here is what I have so far...
public class Currency
{
public int Id { get; set; }
public string Name { get; set; }
//navigation
public virtual List<CrossRate> CrossRates { get; set; }
}
public class CrossRate
{
public int FromCurrencyId {get;set;}
public int ToCurrencyId {get;set;}
public DateTime Date {get;set;}
public decimal Rate {get;set;}
}