Here is the code I'm trying to do:
public IList<IOperator> GetAll() { using (var c = new MyDataContext()) { return c.Operators.ToList(); } }
The operator implements IOperator, but I get the following compilation error:
Cannot implicitly convert type 'System.Collections.Generic.List<MyProject.Core.Operator>' to 'System.Collections.Generic.IList<MyProject.Core.Model.IOperator>'. An explicit conversion exists (are you missing a cast?)
How do I do this to get what I need?
source share