Interviews5 answers
What is Let in linq?
5 Answers
It allows defining a variable and assigning it a value calculated from the data values
Gaurav RautPosted Jan 7, 2018, 11:44 PM EST
It allows defining a variable and assigning it a value calculated from the data values
Gaurav RautPosted Jan 7, 2018, 11:44 PM EST
It allows defining a variable and assigning it a value calculated from the data values
Gaurav RautPosted Jan 7, 2018, 11:44 PM EST
LET keyword allows you to store result of a query which can be used in subsequent query.
example :-
var em = from e in emp
group e by new { e.Salary, e.Id }
into gEmp
let avgsal = (gEmp.Sum(t => t.Salary) / gEmp.Count())
where gEmp.Key.Salary == avgsal
select new { gEmp.Key.Salary, gEmp.Key.Id };
sushil kumarPosted Jul 14, 2017, 9:27 AM EDT
Let is a keyword used to introduce a variable in linq query
arvind sharmaPosted Feb 9, 2016, 9:47 PM EST

