Querying A Database With Linq To Sql Union

In LINQ to SQL, the Union operator is defined for multisets as the unordered concatenation of the multisets (effectively the result of the UNION ALL clause in SQL). For more info and examples, see Queryable.Union. Query Examples; Standard Query Operator Translation; Related Articles.

You can do SQL Union All with Linq and Lambda by following way,

SQL –

SELECT DISTINCT
[UnionAll1].[C1] AS [C1],
[UnionAll1].[Name] AS [C2],
[UnionAll1].[Id] AS [C3]
FROM (SELECT
1 AS [C1],
[Extent1].[Name] AS [Name],
[Extent1].[Id] AS [Id]
FROM [dbo].[Categories] AS [Extent1]
WHERE [Extent1].[Id] IN (71,72)
UNION ALL
SELECT
1 AS [C1],
[Extent2].[Name] AS [Name],
[Extent2].[Id] AS [Id]
FROM [dbo].[Categories] AS [Extent2]
WHERE [Extent2].[Id] IN (74,76)) AS [UnionAll1]

Distant worlds universe serial number. Linq –

var Records1 = from Cats in Context.Categories
where (new List() { 71, 72 }).Contains(Cats.Id)
select new { Cats.Name, Cats.Id };
var Records2 = from Cats in Context.Categories
where (new List() { 74, 76 }).Contains(Cats.Id)
select new { Cats.Name, Cats.Id };

Then connect the red and white audio cables from your Wii to the red and white connectors on the Hauppauge AV cable. If your satellite or cable box or DVR has Component Video connections on the back of the receiver (normally Red/Green/Blue or marked YPrPb), then the answer is 'yes'.By connecting the Component video output from your high definition cable TV or satellite TV set top box to the Component video inputs of the HD PVR 2, you will be able to record the TV programs coming from your set top box to the hard disk. Then, in Hauppauge Capture or Hauppauge Capture, select Composite under Video input and Line In under Audio input.Here is a video which shows you how to use the HD PVR 2 with an Nintendo 64: Would you like to support the HD PVR 2 in your own Windows application? Component video connections are normally the Red/Green/Blue connectors on the back of a set top box. Hd pvr2 drivers for mac. Connect the yellow cable from your console (Nintendo, PS2, Wii or any other game console which has a yellow composite video connector) to the Blue connector on the Hauppauge AV cable.

var UnionResult = Records1.Union(Records2);

Lambda –

var UnionResult = Context.Categories.Where(c=> new List{71,72}
.Contains(c.Id)).Select(c=> new{c.Name,c.Id})
.Union(Context.Categories.Where(c=> new List{74,76}
.Contains(c.Id)).Select(c=> new{c.Name,c.Id})) ;