I am using Entity Framework 4.1 code first
in an MVC 3
app.
I have the following repository:
public class BankRepository : IBankRepository
{
HefContext db = new HefContext();
public ICollection<Bank> GetAll()
{
return db.Banks;
}
}
I get an error when returning db.Banks. I'm not sure what it means, can someone please help clarify and how to change it so that the error goes away? The error is:
Cannot implicitly convert type 'System.Data.Entity.DbSet<MyProject.Core.DomainObjects.Bank>' to 'System.Collections.Generic.ICollection<MyProject.Core.DomainObjects.Bank>'. An explicit conversion exists (are you missing a cast?)
What is returned by db.Banks? An IEnumerable?