I have the following linq query:
var allnews = from a in db.News
where !(from c in db.NewsViews
where c.UserGuid == thisUser.UserGuid
select c.NewsGuid).Contains(a.NewsGuid)
orderby a.Date descending
select a;
I'm wondering what is the best way to optimize it? Or would the query profiler do that for me?
Edit: The idea is to get all the news items that the user has not seen yet. So once a user has seen an item, I stored that item in NewsViews. And the news themselves are in News.