-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queries with "Contains" broken after upgrade from RC2 to RTM #5939
Comments
Does writing all in one big Where work? |
Sorry, already rolled back. Need time to prepare test solution |
Hey, We'll need something that we can run in order to reproduce and debug this one. Trying to reverse engineer your model from the query isn't really feasible. When filing issues, if possible, try to follow the template we provide - which includes the following section:
~Rowan |
Understand that. Here is the solution http://dobrovolskiy.com/Dispatcher.zip Unfortunately due to an other weird error in migrations I cannot apply migrations to empty DB. Column 'Name' in table 'Permissions' is of type 'string'! Might be you can solve it. |
Also I can supply you with SQL generated by that code (traced in sql profiler) exec sp_executesql N'SELECT [s.Apartment].[ApartmentId], [s.Apartment].[BlockId], [s.Apartment].[DenaryPhone], [s.Apartment].[Entrance], [s.Apartment].[Floor], [s.Apartment].[MainPhone], [s.Apartment].[Number], [s.Apartment].[OctonaryPhone], [s.Apartment].[QuaternaryPhone], [s.Apartment].[QuinaryPhone], [s.Apartment].[SecondaryPhone], [s.Apartment].[SenaryPhone], [s.Apartment].[SeptenaryPhone], [s.Apartment].[TertiaryPhone], [s].[ReasonId], [s].[BlockId], [s].[ResponsableId], [s].[WorkerId], [s].[CreatedDate], [s].[ApartmentId], [s].[Description], [s].[DispatcherPhone], [s].[EndDate], [s].[Reasontmp], [s].[StartDate], [s].[ZayavkaId], [s].[ZayavkaStatus], [s].[CreatorId], [s].[EditedDate], [s].[ModifierId], [s].[MainPhone], [s].[SecondaryPhone], [s].[TertiaryPhone] |
Year, ok. Found problem Error appeared then I use conditional construction like For some reason EF Core translate model.status.Count() > 0 ? to SQL query as And this started after upgrade to RTM. I deliberately checked old version (published on server) |
also some play on code .Where(w => (cntstatus == true) ? model.status.Contains(w.ZayavkaStatus) == true : true) // works |
sorry for flood but seems like adding "== true" to Contains method (returning also bool) works |
…to RTM Problem was that we were not translating search expressions into non-search expressions for Extension expressions.
…to RTM Problem was that we were not translating search expressions into non-search expressions for Extension expressions.
fixed in 80b7c08 |
Query with lots of Where now broken and generates "Incorrect syntax near the keyword 'IN'." error.
Query is:
worked fine before upgrade. now I have
SqlException: Incorrect syntax near the keyword 'IN'.
Incorrect syntax near '@__Responsable_6'.
Incorrect syntax near '@__Worker_8'.
and it is just random. Commenting out all Where clauses and it works. adding several WHERE and it breaks. adding random where I got random mistakes mostly Incorrect syntax near the keyword 'IN'
The text was updated successfully, but these errors were encountered: