标签: database class linq-to-sql interface
这可能吗?如何?
据您所知,将类映射到db表我们应该使用TableAttribute(Name="tableName")属性,因此我们不能在接口上使用属性。如果我不使用此属性:
TableAttribute(Name="tableName")
“类型'interfaceName'未映射为表。”
显示。
答案 0 :(得分:3)
这是不可能的。
请参阅MSDN上的TableAttribute Class。
TableAttribute - 将类指定为关联的实体类 用数据库表。