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
It's the easiest way to start using Flagsmith with .NET
Improves Flagsmith adoption across community
Adds support for automatic DI registration
How it should look like
// AppHost.Program.csvarbuilder=DistributedApplication.CreateBuilder(args);varflagsmith=builder.AddFlagsmith();varapiService=builder.AddProject<My_WebApi>("apiservice").WithEnvironment(flagsmith);// Pupulates URL and EnvironmentKey
// ServiceDefaults.Extensions.cspublicstaticTBuilderAddServiceDefaults<TBuilder>(thisTBuilderbuilder)whereTBuilder:IHostApplicationBuilder{builder.AddFlagsmithClient();// Registers FlagsmithClient into DI with URL and EnvironmentKey}
Example of configuration with database
// AppHost.Program.csvarbuilder=DistributedApplication.CreateBuilder(args);varpostgresServer=builder.AddPostgres("postgresserver")// Mount the SQL scripts directory into the container.// Init script would create a flagsmith database, becuase Aspire doesn't create DB by default yet..WithContainerName("postgresserver").WithBindMount("../Postgres","/docker-entrypoint-initdb.d");varflagsmithDatabase=postgresServer.AddDatabase("flagsmithDatabase",databaseName:"flagsmithdb");varflagsmith=builder.AddFlagsmith().WithReference(flagsmithDatabase)// Populates DATABASE_URL.WaitFor(flagsmithDatabase)varapiService=builder.AddProject<My_WebApi>("apiservice").WithEnvironment(flagsmith);
The text was updated successfully, but these errors were encountered:
Hi @LeftTwixWand, thanks for raising this and for sharing the code snippets.
I'm interested to know what this would look like without an official Flagsmith component? Is there an option to, for example, add generic components? Something like builder.AddGenericComponent(MyComponent); ?
Being completely frank here, it's not something that we have the bandwidth to develop or maintain in house, but if you want to submit a PR, or create your own repository to hold the code than of course we'd be more than happy to review / endorse it.
It would be amazing, if we can have Flagsmith Aspire component.
I can provide some help in development of this aspire component.
Why?
How it should look like
Example of configuration with database
The text was updated successfully, but these errors were encountered: