RacerDelux
RacerDelux
Explore posts from servers
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
Thanks!
11 replies
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
Yeah, you are correct, its just a line of code to call the mediatR request haha
11 replies
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
Now that is something I have not messed with yet - but I assume the pipeline may give me an opportunity to make a call out to data and use it?
11 replies
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
So really I would want to guarantee that the database call is only run once though right?
11 replies
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
Right, that was part of what I was figuring out. Is it best to make the getter async, or to do a Task.Run on the database call and make that async? For either option, what happens if multiple services make a call to that variable before the initial call returns the value?
11 replies
CC#
Created by RacerDelux on 9/17/2024 in #help
Best Way To Load and Cache Scoped Data?
Further info, each time I use this Configuration table, in 4 different scoped services, they will look something like this:
context.Configuration.where(c => c.key == "some key").FirstorDefaultAsync();
context.Configuration.where(c => c.key == "some key").FirstorDefaultAsync();
Where, in each instance, the configuration key is different
11 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
I will celebrate the day we get rid of it
16 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
because it is also looking at a json column =/
16 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
It does work, but it is VERY VERY VERY slow
16 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
(I only pasted a partial, the order by logic has a lot of steps in reality, was trying to adopt it to this new logic)
16 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
in raw SQL this query would be complex as is
16 replies
CC#
Created by RacerDelux on 7/24/2024 in #help
Dynamic Order By Entity Framework
Not sure. Looked into it more, I am pretty confident that EF doesn't have a way to do this
16 replies
CC#
Created by cyan_live on 9/9/2022 in #help
Solution to mixing SQL queries with entity framework entities
I would just configure the database then. You can map tables and columns to fix that. I would go that route and use linq over SQL for 99% of tasks.
37 replies