How to SELECT WHERE NOT EXIST using LINQ?

前端 未结 5 791
余生分开走
余生分开走 2020-12-13 23:33

I have to list all \"shift\" data to be assigned to an \"employee\" but shift data must not be included if it is already existing in employ

5条回答
  •  时光说笑
    2020-12-13 23:38

            Dim result2 = From s In mySession.Query(Of CSucursal)()
                          Where (From c In mySession.Query(Of CCiudad)()
                                 From cs In mySession.Query(Of CCiudadSucursal)()
                                 Where cs.id_ciudad Is c
                                 Where cs.id_sucursal Is s
                                 Where c.id = IdCiudad
                                 Where s.accion <> "E" AndAlso s.accion <> Nothing
                                 Where cs.accion <> "E" AndAlso cs.accion <> Nothing
                                 Select c.descripcion).Single() Is Nothing
                          Where s.accion <> "E" AndAlso s.accion <> Nothing
                          Select s.id, s.Descripcion
    

提交回复
热议问题