Skip to content

Instantly share code, notes, and snippets.

@syedharoonmca
Created December 5, 2022 04:34
Show Gist options
  • Save syedharoonmca/902b829717e5c47d3070865c49690d63 to your computer and use it in GitHub Desktop.
Save syedharoonmca/902b829717e5c47d3070865c49690d63 to your computer and use it in GitHub Desktop.
MixedSyntax
using System;
using System.Collections.Generic;
using System.Linq;
namespace LINQDemo
{
class Program
{
static void Main(string[] args)
{
//Data Source
List<int> integerList = new List<int>()
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
};
//LINQ Query using Mixed Syntax
var MethodSyntax = (from obj in integerList
where obj > 5
select obj).Sum();
//Execution
Console.Write("Sum Is : " + MethodSyntax);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment