How can I form a Linq to sql Query for this code in SQL, I tried several things. This is my basic code:
List<Movie> movies =
(from item in db.Movies select item).ToList<Movie>();
return movies;
This is what I want as a result.
select (Won/Total) as 'rankPercentage'
from dbo.Filmranking
order by rankPercentage desc
Thanks
At this point, movies will be a
List<T>where T is a float or int depending on the underlying SQL type (which I cannot discern from your question). If you really want to project this back as aList<Movie>, you will need to project that as follows but your result is not likely to match your SQL table.