c# - LINQ to SQL where ID not in some_list -


I am trying to create a SQL statement from a LINQ that filters out the result where the ID does not In some list of integers I realize that () Method can not be used in linq in SQL, but for the purpose of explaining what I want to do, this is what I want to do:

  nextInvention = (In the IContext.Inventions inv.DateSubmitted ascending selection by inv. By inv. First & lt; Search & gt; ();  

Any ideas how can I go about doing this?

Thank you!

can contain LINQ to SQL Is being used in ... The usual way to query this "IN" is to remind me of some ambiguity that there are some restrictions, but it certainly can work around the types of restrictions that can be done around ... This history list a list T & gt; Is ? This is likely arbitrarily IEnumerable & lt; T & gt; is not supported for example, for example.

Now, I do not know the result is "work", but trying to minimize it, have you tried the exact question from your question?

One point to note: I think the readability of your query will improve if you try to keep one line per line:

  var nextView = (Some of the inv in iContext.Inventions! History list includes (inv.Id) orderby inv.DateSubmitted ascending selection inv). first ();  

Also keep in mind that in this case, the method syntax is rationally simple:

  var nextView = iContext.Inventions Where (inv = & gt;; History list. (IAD) .orderbie (Invi => inv.DateSubmitted). First ();  

Comments