Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Linq2DB 对数据库优先应用程序进行 POC,但我似乎无法找到解决此问题的正确方法。有没有办法将两个表的结果映射到一个 POCO 类?有没有例子表明这一点?谢谢!
如果result of two tables您的意思是查询两个表的结果,那么您只需要编写 linq 查询并将所需的列选择到您的类的字段/属性中:
result of two tables
from t1 in db.GetTable<Table1>() join t2 in db.GetTable<Table2>() on t1.Key equals t2.Ket select new ResultClass() { Field1 = t1.SomeField, Field2 = t2.SomeOtherField }