camel
❔ FluentAssertions excluding collection elements
I have two IEnumerable<Claim> tmp1, tmp2 and I want to see if they are equal, except for the claims "exp", "nbf", "iat" because those are timestamps and dependent on the execution time. How can I solve this without having to mock every single thing that gives a time?
7 replies
Inject http client only for specified service [Answered]
I have a RemoteApiClient that I want to inject to the FooBarService and only to the FooBarService. The reason for this is that the RemoteApiClient is not really meant to be used directly. How do I achieve this? Additionally, the IMemoryCache is injected into the FooBarService, but the IMemoryCache is also used elsewhere.
32 replies
Manipulate browser session storage manually to hack claims into Blazor
I'm trying to figure out how to manually add a claim through the browser so that Blazor shows me things protected by <AuthorizeView Policy="HasHackedClaim">. I want to prove to my colleagues that handling authentication only in the Blazor client is a bad idea if the API is not protected with authentication, even if the API is not publically exposed.
1 replies
Inject AppDbContext with parameterized constructor
I'm trying to encapsulate the AppDbContext, so everything needed is passed in the constructor.
If I omit the "<IAppDbContext, AppDbContext>", it works for projects that have a reference to the Infrastructure, where AppDbContext resides. But if I want to use the IAppDbContext to inject it anywhere, it doesn't want to migrate.
The error:
"Unable to create an object of type 'AppDbContext'. "
36 replies