我有一个查询,它应返回TRUE或FALSE.
var query = from c in db.Emp
from d in db.EmpDetails
where c.ID == d.ID && c.FirstName == "A" && c.LastName == "D"
// It should return TRUE when this above statement matches all these conditions
Run Code Online (Sandbox Code Playgroud)
我想将此查询结果附加到属性(字符串数据类型)
this.result = Conert.ToBoolean(query);
Run Code Online (Sandbox Code Playgroud)
如何在LINQ中实现这一点?
编辑:
EmpMapper类
public class EmpMapper
{
EmpEntities db;
// ID column already exists in the DB
private int ID;
// I am creating this property to add it from the UI side, depending on the certain conditions in …Run Code Online (Sandbox Code Playgroud)