Q:

Can I use an Interface as a property with Entity Framework? 

I have the following class which is a model for a database table:
public class User : IUser
{
    internal int Id { get; set; }

    public string Name { get; set; }
    public string Email { get; set; }

    public ITest TestData { get; set; }
}

When I run Update-Database command, it throws an error:

The property User. TestData is of an interface type (ITest).  If it is a navigation property manually configure the relationship for this property by casting it to a mapped entity type

How and where can I manually configure the relationship for this property if I do not want the actual property to be a class? 

A:

EF does not support interfaces, but you can deal with it this way.  Take a look on this solution How to use interface properties with CodeFirst

