Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

I am Jalpesh Vadgama a Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having more then 6 years of experience in .NET Technology.
Browse by Tags · View All
#ASP.NET 88
#DOTNET 87
BRH 79
ASP.NET 72
#.NET 52
C#.NET 48
DOTNET 44
ASP.NET 4.0 31
ASP.NET MVC 29
VisualStudio 27

Archive · View All
December 2010 16
July 2011 13
April 2011 13
April 2012 12
January 2011 12
June 2011 11
May 2011 11
May 2012 8
February 2013 7
January 2013 7

Using Let Keyword in Linq

Aug 25 2010 3:52AM by Jalpesh   

I am using Linq-To-Object in my current project to remove some extra loops and I have found one of the great keyword in Linq called ‘Let’. Let keyword provides facility to declare a temporary variable inside the Linq Query.We can assign the result of manipulation to temporary variable inside query and we can use that temporary variable to another manipulation.

Let’s take a simple example of Linq query I am using an integer array to find square and after finding the square of the integer value I will use let keyword to find square value which are greater then 20. Here is the my query for that.

 

protected void Page_Load(object sender, EventArgs e)
{

            int[] intArray = { 1, 2, 3, 4, 5, 6, 7, 8 };
            var Result = from i in intArray
                         let square = i * i
                         where square>20
                         select square;
            foreach (int i in Result)
            {
                Response.Write(i.ToString());
                Response.Write("\n"); 
            }
}

Here is the result of that query as expected.


LetResult

Let keyword is more useful when you are working with directories and files,xml manipulations so here possibilities are unlimited. Hope this will help you.. Happy Programming!!! 

Tags: Linq-To-SQL, Entity, BRH, #DOTNET, #LINQ, Linq-To-Entities, Let,


Jalpesh
15 · 11% · 3478
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • Let is added advantage to fix some performance problems and simplifise the queries

    commented on Sep 24 2011 12:20PM
    Hima
    31 · 6% · 1776

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]