I am trying to wrap my head around the Entity Framework, and I am having trouble understanding how the interface can be encoded (or, perhaps, is it possible to encode the interface). I am pretty confident in C #, but mainly because of my ability to program in many other languages, so goodbye to any ignorance.
Given:
public interface IInputSource
{
float GetCurrentValue(DateTime timestamp);
}
public class PatternSource : IInputSource
{
…
float GetCurrentValue(DateTime timestamp)
{
}
…
}
public class TimeSeriesSource : IInputSource
{
…
float GetCurrentValue(DateTime timestamp)
{
}
…
}
I want to code the node class for an interface, since there are 5 or 6 different types of sources:
public class Node
{
…
public IInputSource Inflow { get; set;}
…
}
It seems that the O / M from the Entity Framework will never be able to solve the specific class that node will refer to, and as such, simply will not be able to encode the interface. Is this really so?
If not, can someone give me an example of how this will be done in EF 4? I am using VS2010 and .NET 4, and I am proceeding from the code mentality).