As I am configuring things I am wondering where I should store variables in server side blazor project
Could you provide guidance on how to store variables.
For example: I ended up putting a appsettings.json on the client side project and using IConfiguration and then just doing
public class Startup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
At startup.cs. But should I have put this on Server project. Should there be a "blazor way" to store configs?
The way I do it at the moment is through embedding the config to the ClientApp.dll using MSBuild. See aspnet/Blazor#1152 for how I do the embedding and also how others have are doing it at the moment.
@jvelezc What you're doing is totally fine. ASP.NET Core's configuration system lets you combine config sources from multiple locations, so if you want to have some config files in your Blazor app project, that's the way to go.
@RyoukoKonpaku I think @jvelezc is asking about server-side apps, so embedding the resource isn't required.
Ah I see then yes it's not required since it's essentially a normal netcore app.
Thanks!