15 Replies
@viceroypenguin | 🦋🐧🌟 here
need to get tenantid from a separate service in order to setup the correct context
oh, create a singleton cache wrapper. the wrapper has an async call to get the id. that async method can call cache.getorcreate(), and have the async lambda to pass to getorcreate.
also... for the love of all that is holy, use refit instead of whatever that mess is
straight paste into discord
whats refit
https://github.com/reactiveui/refit
make your life infinitely easier when making calls to a rest api
this sounds weird but ill try it
that?
yes
So it’ll be the same CacheWrapper with a new scoped IMemoryCache
And I call that inside of AddScoped?
except that
factory
shouldn't be part of the public api. make the public api just take in the key, and use a protected abstract method that gets the value
and then implement TenantContextFactory : CacheWrapper<string>
tenantcontextfactory can also take an IServiceScopeFactory
, to create a temporary scope in it's Factory()
method
the temporary scope can give you things like the ihttpclientfactory, to go make api callsI don’t know what any of that looks like but I’ll see what I come up with lmao
You lost me at make a protected abstract method
All I know is the key part is on ever request the host needs to resolve a Guid value
The api call is to get it if it is not in cache
And since it’s a low volatility data it can stand to stay stale for a long time
Is this how one would do subdomain driven multi tenancy?
Oh I was gonna give it a shot and show you my cursed interpretation of what you said
But I’ll try this lol
wait why
abstract
and not virtual
for Factory()
?so that
CacheWrapper<>
doesn't have to implement the methodoh, i was not aware thats what it did
TIl
inheritors do implement
nice
anyone know of a way to get .editorconfig to apply to an entire solution?
is it as simple as putting it at the solution level?
yes
of course its that easy
I just realized I was not in chat when I posted that