Ray's Asp.net Blog

Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)

Pages

▼

Monday, August 29, 2011

How to implement SQL Distinct keyword in LINQ?

There is a Distinct keyword in LINQ, but not as same as in SQL.
Following is the same implementation for SQL distinct in LINQ

    var distinctItems = items
       .GroupBy(x => x.PropertyToCompare)
       .Select(x => x.First());

http://blog.jordanterrell.com/post/LINQ-Distinct()-does-not-work-as-expected.aspx


HOW TO GET DISTINCT VALUES FROM THE LIST<T> WITH LINQ


at 11:44 AM No comments:

NerdDinner being updated to MVC3 with Razor, HTML5, GeoLocation, EF CodeFirst, jQuery Mobile, YepNope and Modernizr and a fixed Mobile Device Capabilities ViewEngine

http://www.hanselman.com/blog/NerdDinnerBeingUpdatedToMVC3WithRazorHTML5GeoLocationEFCodeFirstJQueryMobileYepNopeAndModernizrAndAFixedMobileDeviceCapabilitiesViewEngine.aspx
at 10:10 AM No comments:

Trigger file downloads with a MVC 3 controller action

http://dotnetslackers.com/articles/aspnet/Trigger-file-downloads-with-a-MVC-3-controller-action.aspx
at 9:41 AM No comments:

How to avoid the Session fixation vulnerability in ASP.NET

http://www.dotnetfunda.com/articles/article1395-how-to-avoid-the-session-fixation-vulnerability-in-aspnet-.aspx
at 9:21 AM No comments:
‹
›
Home
View web version
Powered by Blogger.