S
shapper
Hello,
I have the following LINQ:
List<Tag> tags = (from t in
database.Tags
select t).ToList();
I need to restrict my results and for that I have two parameters:
StartWidth and N
I would like to change my Linq query to do as follows:
1. Select all tags which tag.Name starts with the value contained in
StartWidth parameter.
NOTE: Both tag.Name and StartWidth are strings.
AND
2. Get the first N tags from that list ordered alphabetically.
NOTE: If N = 0 then get all tags
How can I do this?
Thanks,
Miguel
I have the following LINQ:
List<Tag> tags = (from t in
database.Tags
select t).ToList();
I need to restrict my results and for that I have two parameters:
StartWidth and N
I would like to change my Linq query to do as follows:
1. Select all tags which tag.Name starts with the value contained in
StartWidth parameter.
NOTE: Both tag.Name and StartWidth are strings.
AND
2. Get the first N tags from that list ordered alphabetically.
NOTE: If N = 0 then get all tags
How can I do this?
Thanks,
Miguel