You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often, we want to use Intent Architect to bootstrap the application but still allow us to configure it.
Take multi-tenant for example
Here is the generated code
services.AddMultiTenant<TenantInfo>()
.WithConfigurationStore() // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Stores#configuration-store
.WithHeaderStrategy("X-Tenant-Identifier"); // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Strategies#header-strategy
This works great, but let's say I want to add a fallback tenant.
The only way to do that is to change the code.
//IntentIgnore
//IntentMatch("services.AddMultiTenant<TenantInfo>()")
services.AddMultiTenant<TenantInfo>()
.WithConfigurationStore() // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Stores#configuration-store
.WithHeaderStrategy("X-Tenant-Identifier") // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Strategies#header-strategy
.WithStaticStrategy("realm-digital");
Again, this works, but I have opted out of Intent Architect managed code, so changing this from, say "Header Strategy" to "Host Strategy" in Intent Application settings would not result in code change.
Describe the solution you'd like
Builders should be exposed so that they can be extended.
e.g.
public static IServiceCollection ConfigureMultiTenancy(
this IServiceCollection services,
IConfiguration configuration)
{
var builder = services.AddMultiTenant<TenantInfo>()
.WithConfigurationStore() // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Stores#configuration-store
.WithHeaderStrategy("X-Tenant-Identifier"); // See https://www.finbuckle.com/MultiTenant/Docs/v6.12.0/Strategies#header-strategy
// I can now safely add this line, along with `[IntentManaged(Mode.Merge)]`
builder.WithStaticStrategy("realm-digital");
return services;
}
This example is multi-tenant specific, but should apply to other builders.
The text was updated successfully, but these errors were encountered:
I've logged a ticket for the team to discuss and will revert.
We as a general rule try to produce code which is in line with what a developer would manually code.
In this example it would be weird to see a "var builder =", where the builder is never used, which is what anyone not extending this pattern would get.
The other options here would be:
a) to put that statement on Ignore, which you have mentioned, I don't think this is a bad option given this setup code would generally not change often.
b) have a custom module which extends the builder statement, adding in your custom code
Have chatted to the team and we've logged a ticket to see if we can extend the code management system to allow for an "Intent Ignore" on the Chained method invocation.
What problem are you trying to solve?
Often, we want to use Intent Architect to bootstrap the application but still allow us to configure it.
Take multi-tenant for example
Here is the generated code
This works great, but let's say I want to add a fallback tenant.
The only way to do that is to change the code.
Again, this works, but I have opted out of Intent Architect managed code, so changing this from, say "Header Strategy" to "Host Strategy" in Intent Application settings would not result in code change.
Describe the solution you'd like
Builders should be exposed so that they can be extended.
e.g.
This example is multi-tenant specific, but should apply to other builders.
The text was updated successfully, but these errors were encountered: