Unmei
How to effectively dispose unmanaged resources?
When you "something you created", would it include objects created with
using
statements? Like using scopedService = serviceProvider.GetRequiredService<IUserService>()
or even those are handled "automagically"?12 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
it would be something like that. EF generates the query when using
ToQueryString()
but I don't have the exact query right here. It is almost the same as this one, only differences are what it bring in the select and order by statements30 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
I will still go back to this and test what happens if I build relations between the tables in EF’s configuration and make the query normally, but multiple where clauses is acceptable since it was a production defect.
30 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
Not individual queries, but individual “where” clauses for each user. In the tests I made, it would create two variables for each user, their username and they dateDisabled and use them in the where clause.
A query filtering by 46 users is executed in roughly 1.2 seconds, which isn’t that bad if compared to the ideal scenario of having the PK/FKs and letting database management figure it out.
30 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
Thanks for the help. That would be a viable solution too. I was avoiding to try and use Contains since Orders.CreateBy and User.UserName are not PK/FK correlations, thus it could impact performance somehow. Database in this project is all messed up and I can’t change it now 🥲
30 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
ordersQueryForDebug
will render SQL Select statement correctly with the "where" clause just as expected. It also creates all the constants needed for the expressions created, like user.UserName
and dateDisabled
30 replies
Is it possible to build a custom Expression<Func<T, bool>> by chaining "Or" operations to use in EF?
30 replies