c# - Linq query EntityCommandExeceptionException error -


When I call 'api / test / name = stop, tap, app ... (24 names values)' I am experiencing an error below, below the query below:

  "message": "An error occurred.", "Exception message": "Some part of your SQL statement Is very nested nested. It breaks into queries or short queries. "," Exception type ":" System.Data.SqlClient.SqlException   

Linq query:

  var data = db.database_bd.AsQueryable (); if (query.startDate! = Null) {data = data where (c => c.Uploa dDate> = query.startDate);} // If any other filter is specified, return records that match one of these: var filteredData = new list & lt; IQueryable & lt; database_bd & gt; & gt; ;;;;); If (! String.IsNullOrEmpty (query.name)) {var ids = query.name.Split (','); foreign (ids in string i) {filteredData.Add (data.Where (c = Gt; c.Name! = Null & amp; amp; amp; amp;; c; name; insertion (i));}} // If no filter has been passed, all data will be returned Return. // Otherwise, combine indie to return all the filters using the Univian method which matches at least one filter. If (filtered data! Count! = 0) {data = filteredData.Aggregate (Queryable.Union); } If the error {var message = string.Format ("no data was found") due to (.data.nei ()) // line; Return request. CreteErrorpressPage (HTTTAS code.Notfound, message); } Return request. Create Response (HTTPTat Code.OK, Data); }   

query class:

  public class questions {public string name {get; Set; } Public taps qualified & lt; DateTime & gt; Getting started {Get; Set; } Public taps qualified & lt; DateTime & gt; {End date; Set; }}   

I tried to add a border in the 'Filter Data' method, but I could not get it to work. Any advice would be very much appreciated.

Thanks

Does this not work?

  var data = db.database_bd.AsQueryable (); If (query.startDate! = Null) {data = data. Where (c => c.upploadDate> = query.startDate); } If (! String.IsNullOrEmpty (query.name)) {var list = query.name.Split (','); Data = data Where (public relations = & gt; list. Any (pr2 = & gt; pr.Name.Contains (pr2))); }    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -