假设我有一些接口,例如:
public interface IIconComponent
{
// statements ...
}
然后我在我的类中实现这个接口,如下所示
public class IconComponent : IIconcomponent
{
// implementing the interface statements ..
}
并在 mvc3 中创建一个表,如:
public class IconDBContext : DbContext
{
public DbSet<IIconComponent> Icon {get; set;} //Is this statement possible
}
那就是制作接口类型的对象集,用于在表中存储类 IconComponent 对象。如何在 MVC3 中做到这一点?
我是否必须为此实现一些模型绑定器?或者,还有其他方法吗?
感谢您,