相关疑难解决方法(0)

Linq查询返回true或false

我有一个查询,它应返回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)

c# linq linq-to-sql

13
推荐指数
3
解决办法
5万
查看次数

标签 统计

c# ×1

linq ×1

linq-to-sql ×1