Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# LINQ到实体-如何将SQL查询(UnionAggregate)转换为LINQ_C#_Sql Server_Linq To Sql_Spatial Query - Fatal编程技术网

C# LINQ到实体-如何将SQL查询(UnionAggregate)转换为LINQ

C# LINQ到实体-如何将SQL查询(UnionAggregate)转换为LINQ,c#,sql-server,linq-to-sql,spatial-query,C#,Sql Server,Linq To Sql,Spatial Query,我想将其LINQ中的以下SQL查询转换为实体版本: select geometry::UnionAggregate(geometries.GeometryBounds) from ( select GeometryBounds from Province where id in ( 1, 2 ) union all select GeometryBounds from Region where id in ( 1, 2 ) uni

我想将其
LINQ
中的以下SQL查询转换为实体版本:

select
 geometry::UnionAggregate(geometries.GeometryBounds) 
from 
( select 
    GeometryBounds
  from 
    Province where id in ( 1, 2 )
  union all
  select 
    GeometryBounds
  from 
    Region where id in ( 1, 2 )
  union all
  select 
    GeometryBounds
  from 
    Country where id in ( 1, 2 ) 
) as geometries

在LINQ union中,Collection.Concat()方法提供的所有函数


请参阅msdn:@FakeisMe我想做的是SQLGeometrics的联合聚合,而不是RAW的联合,谢谢。
var ID = new[] {1, 2};

var query = (youContext.Province
            .Select(x => x.GeometryBounds))
            .Concat
            (youContext.Region
            .Select(x => x.GeometryBounds))
            .Concat
            (youContext.Country
            .Select(x => x.GeometryBounds));