I am building the multi tenant app and trying to get the data security working now. Unit tests of Context are working nice because I create the context with options and UserContext, but I am struggling to get it working in assembly as it needs userContext to be injected.
I cannot use standard controller injection as with everything else, as if I have it, the context creation fails:
services.AddEntityFrameworkNpgsql()
.AddDbContext<MultiTenantContext>(o =>
o.UseNpgsql(Configuration.GetConnectionString("DbContext")
I cannot or I do not know how to inject my UserContext this way...