How to use Union Operator with Entity Framework

Goldytech
Posted by Goldytech under Others category on | Views : 13193
The sample snippet shows how to use the Union operator similiar to T-SQL

public void UnionExample()
{
var india = context.Orders.Where(o => o.ShipCountry == "India").Select(o => o);
var china = context.Orders.Where(o => o.ShipCountry == "China").Select(o => o);
var IndiaUnionChina = india.Union(china);


}

Comments or Responses

Login to post response