The mapping of interface member IDisplayOrder.ID is not supported.

Country 是Linq to sql 的一个实体类

如果我们按这个代码运行的话就会得到The mapping of interface member IDisplayOrder.ID is not supported.

注意看Exchange的代码

一个方法是先where 后FirstOrDefault 这个方法可以使用。而如果直接用FirstOrDefault 的话就会有错了

Code

Code
WebDC dc = new WebDC(DataObject.connstr);
        ABC
<Country> biz = new ABC<Country>(dc);
        biz.Exchange(
20,21);
        dc.SubmitChanges();
原文地址:https://www.cnblogs.com/lovebanyi/p/1467890.html