Dear all,
I've got a view in SQL Server 2005 (in readcommitted rowversioning mode), whose query statement looks as the following:
SELECT TOP (100) PERCENT l.ID, l.Name
FROM
dbo.Location l
INNER JOIN dbo.LocationType lt
ON l.TypeID = lt.ID
WHERE
lt.Name = 'Country'
ORDER BY
CASE
l.ID
WHEN 225 THEN 2
WHEN 161 THEN 1
END DESC,
l.Name
I did map the view with an entity, but unfortunately when fetching the data in a collection, it is ordered by ID (as happens to be also if I issue a "select * from vCountry" on SSMS, anyway). I thought I may fix that if I could translate the query on LLBLGen Pro, but I couldn't find any documentation showing a support for the case statement. Is it there? Any alternative option (apart from the trivial "adding a sort column", of course)?