I have a comma delimited list of record id's:
string = "2207,117,90,2168,120,118,113,112,17"
I need to be able to load the records those id's are associated with in the position that they are in that string.
Here is the code I am using to get my data using LINQ to EF with LINQ Methods:
var styles = db.DataModel.Categories.Where(c => c.CategoryTypeID == 5 && c.Enabled).OrderBy(c => c.Name).ToList();
Is there anyway that the above query can be modified to get the records in the order that they are in the above list of record id's?
I am not sure how to do this. Any help/example would be greatly appreciated.
I am using LINQ Methods to EF 4.0 + C#
Thanks!