Extension methods are indeed allowed in LINQ queries; moreover, LINQ methods are implemented as extension methods.
Another problem is to use extension methods (or most other methods) in LINQ to SQL or LINQ to-Entities queries. These queries are not actually executed in C # code, but they are treated as expressions translated into SQL. I.e.
db.News.Where(x => x.Published).Select(x => x.Name)
converted to SQL statement
Select Name From News Where Published = 1
and the results are returned in C # code.
Since there is no way to pass the ToFriendlyUrl() method to SQL, your code throws an error.
You have basically two solutions / workarounds. One of them is to convert the call into a form that can be translated into SQL, for example. if the ToFriendlyUrl() method was simple:
public static string ToFriendlyURL(this string value) { return value.ToLower(); }
you can embed this code in a LINQ call and it will work. If, however, the methods are more complex than your only solution is to simply extract the data from the database and then process it from C #:
var newsTypeQuery = db.NewsTypes.Where(x =>
Sweko source share