Hi Can any one please help
I like to do custom sort using linq ,
Below is the sample to do in SQL Server. I like to do using LINQ
C#
USE [SqlAndMe] GO SELECT CountryName FROM dbo.Country ORDER BY CASE WHEN CountryName = 'INDIA' THEN '1' WHEN CountryName = 'CHINA' THEN '2' ELSE CountryName END ASC GOCountryName
INDIA
CHINA
AUSTRALIA
BANGLADESH
FRANCE
JAPAN
NEW ZEALAND
PAKISTAN
SRI LANKA
UNITED KINGDOM UNITED STATES

Ananth Padmanabham vemula98 reputationPosted Jan 2, 2015, 12:06 AM EST
I hope below query will useful for you.
var getdata = (from i in dc.Country select i).OrderBy(x => x.CountryName);
VulpesRank #55 · 29.2K reputationPosted Jan 2, 2015, 1:19 AM EST
Rahul SinghRank #1,323 · 1.3K reputationPosted Jan 5, 2015, 4:23 AM EST
List