cypherpotato
✅ Why ins't this EF Core query being evaluated client-side?
Currently, I have this query:
In the query above, in the
Database.KanbanCards
sub-query I make the rest of the query client-side to transform the "a.AssociatedUsers" column into other information. This is an JSON column.33 replies
Generic converter bounding in EF Core
Is there an way to "easily" define converters for all properties which uses an generic type? Currently, I have something like this:
and an ugly static method that gets all properties from entities, map eachs one and applies the converter using reflection and activator.
3 replies
Why ins't inlining working here?
Just doing an experiment. The following code are not inlined by the compiler:
https://sharplab.io/#gist:692cc1af66c352c2e8138dad6f033959
7 replies
can I specify an Type wildcard for GetMethod?
I have both methods:
I can invoke
DoFoo
with two parameters through reflection with:
However, I'm in a scenario where I don't know what one of the types is, because I get them from a collection of objects and through each object I get its type. When an object is null, it is not possible to determine its type, as they are all object?[]
.
I needed a way to specify a wildcard in a certain type position. Is there any way to do this?7 replies
✅ Disable trimming for certain assemblies
Hello.
There's a way to disable code trimming for certain assemblies?
I just want to AOT-Compile my application, but trim only CLR assemblies and not the principal assembly. My code does use a lot of dynamic code, so it would be trimmed on an AOT-compilation.
Thank you.
6 replies
✅ Disjunctive patterns negation
Hey there.
I was wondering why my disjunctive is not working as intended:
The last expression result doesn't make sense for me, because I'm checking if
authUser.Level
is not Administrator
or Internal
, and it actually is Internal
as shown in the first expression, so the result should be false
.
What i'm doing wrong?12 replies
✅ is there any way to cast Task into Task<object>?
so, i have this delegate function:
which some methods already implements it, and some of then are async that returns
Task<something>
, and i need that value inside that task.
for non Task<T> methods i can have it using:
and fine, but if it is Task<something>
i can only determine if it is an task using:
but it doens't has the .Result
property since it's an Task
and not Task<T>
i can unsafely cast it and get it result using
but it only works when T
is an reference-type and doens't works when T
is an struct/value type object.
so, I need to get the value of Task<T> actionResult
when actionResult is a Task<T>
, but I don't know what <T>
is. how do I managed to get it?
using reflection to get the .Result
property value requires a lot of resources and costs a lot of performance.
7 replies