我想要一个字符串列表,并使用 EF-CodeFirst 将它们保存并加载到数据库中。这是我的 DbContext 类:
public class KeysDbContext : DbContext
{
public DbSet<string> Keys { get; set; }
}
但是当我尝试运行代码时,我得到了这个异常System.InvalidOperationException
::The type 'System.String' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject.
我该如何解决这个问题?