zoukankan      html  css  js  c++  java
  • linq to ef(相当于sql中in的用法)查询语句

    select * from DoctorInfo doctor
    where doctor.HosDepartId in
    (select Id from HospitalDepartment hd
    where hd.DepartmentId=5)


    var a=from d in _entity.HospitalDepartment
    where d.DepartmentId==5
    select d;

    List<int> lst=new List<int>();
    foreach(var b in a)
    {
    lst.add(b);
    }

    var doc=from c in _entity.DoctorInfo
    where lst.contains(c.HospitalId)
    select c;

  • 相关阅读:
    其他
    Win10
    Win10
    面向对象与设计模式
    Git
    Java
    Git
    Git
    Git
    一、I/O操作(File文件对象)
  • 原文地址:https://www.cnblogs.com/love828/p/3918031.html
Copyright © 2011-2022 走看看