Question: I have two tables "Category" and "Movie" with 1-M relationship ('CategoryID' is a Foreign Key in the table "Movie").
I'm using a ListView to list all Categories. Inside of my ListView is Repeater that loops through all movies within each category. 

In my code-behind,I'm binding the ListView DataSource as follows:

```
MovieDBDataContext context = new MovieDBDataContext();
var categories = context.Categories.Select(x => x).OrderBy(x => x.Order).ToList();                           

ListView1.DataSource = categories;
ListView1.DataBind(); 

```

and I'm binding the Repeater DataSource in the markup as follows:

```
<asp:Repeater runat="server" ID="repeater" DataSource='<%# ((Category)Container.DataItem).CategoryItems.Where(p => p.Active == true).OrderBy(p => p.Name) %>'>

```

Now I'm having a requirement where I need sort my movie by name, but if a movie starts with "The " than I need to disregard that and sort on the rest of the name (so "The Lord of the rings" will be sorted as "Lord of the rings").

Is there a way to modify my Linq statement to manipulate strings in such a way on the fly?

Answer: 
```
((Category)Container.DataItem).CategoryItems.Where(p => p.Active == true).OrderBy(p => p.Name.StartsWith("The ") ? p.Name.Substring(4): p.Name)

```
You can make a class Categories in which you can have the attributes that you need. 

```
public class Categories {
    public string Movies { get; set; }
    public string Category { get; set; }
}

```

I don't know exactly what you are getting from your database, but for each item you can make a n attribute which will allow you to get the data from the database and store it as type object.

When you actually fill in the data, you can use the following code

```
List<Categories> categories = .Select(x => new Categories { 
Movies = (x.Movies.substring(0, 3).ToLower().Equals("the")) ? 
x.Movies.substring(3) + ", " + x.Movies.substring(0, 3) : 
x.Movies, Category = x.Category).OrderBy(x => x.Order).ToList();

```

Now the data that you have should be correctly formatted to do what you were trying to do as before.