nox7
nox7
CC#
Created by nox7 on 7/22/2024 in #help
How Can I Debug ASP Core Controller Registered, but Not Matching?
I'm just silly. The attribute needed a blank string in the argument for HttpGet. It works now.
2 replies
CC#
Created by nox7 on 4/24/2024 in #help
Mutex? ASP Core - Only Allowing a Method to Be Run One at a Time
This is an example of what I am thinking to do for a service method, but am not sure if this is a proper Mutex implementation - because of the asynchronous access to Redis
public async Task GetBlogArticles()
{
var redis = RedisProvider.GetConnectionNotNull();
var redisDb = redis.GetDatabase();

string cacheKey = "client:dashboard:blog-articles";
var cachedBlogsRedisValue = await redisDb.StringGetAsync(cacheKey);
if (!cachedBlogsRedisValue.HasValue)
{
// Needs to be cached, lock mutex and fetch from API
FootbridgeBlogFetchMutex.WaitOne();
}
else
{
// No mutex lock needed, continue
}
}
public async Task GetBlogArticles()
{
var redis = RedisProvider.GetConnectionNotNull();
var redisDb = redis.GetDatabase();

string cacheKey = "client:dashboard:blog-articles";
var cachedBlogsRedisValue = await redisDb.StringGetAsync(cacheKey);
if (!cachedBlogsRedisValue.HasValue)
{
// Needs to be cached, lock mutex and fetch from API
FootbridgeBlogFetchMutex.WaitOne();
}
else
{
// No mutex lock needed, continue
}
}
Though, now I am starting to think to just store a Task object as a static method of the service class object and have any future calls await that task if it exists...
2 replies
CC#
Created by nox7 on 4/15/2024 in #help
EF Core - Runtime-Based "OR" "AND" Comparison in Where()
Late update on this, but yes it worked as described - I was able to create dynamic query filters with expression objects.
8 replies
CC#
Created by nox7 on 4/15/2024 in #help
EF Core - Runtime-Based "OR" "AND" Comparison in Where()
Thanks for the resource - I'll take a look and test it out.
8 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
I use a custom user system
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
Because two users can be logged in at one time
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
I don't use that system in my app
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
I don't use the normal identity system, but I get what you're saying.
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
Ah, I see what you mean. That's not a bad idea either.
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
This works well and as I need it to, so thanks.
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
No description
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
So I wanted to have it all (all 404 scenarios) propagate up to the top and then the top handles it based on the currently authenticated user
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
There are other situations I need the 404 page to be shown. E.g., when an object is missing from a request Url that has an Id in the parameter.
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
E.g., I am trying to show 3 different 404 views. One for authenticated clients, one for authenticated staff, and one for non-authenticated users
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
MVC/Razor
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
I guess I could use it and just handle the logic I need within the Controller I redirect to (showing different views). So I'll go down that path
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
Ah, we thought the same thing
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
UseStatusCodePagesWithReExecute is almost there, but it doesn't give me much controller in directing it to completely different routes
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
Yeah, I've read through that - unfortunately it doesn't do what I need here. It forces me to use their internal error handling. Or in the case of a custom IExceptionHandler - only when an exception is thrown. I need it to go to custom paths based on specific HttpContext data.
41 replies
CC#
Created by nox7 on 4/3/2024 in #help
ASP Core 8 - Custom 404 Handling
No description
41 replies