Blazor access value from program.cs from a component [duplicate]

I have a Blazor Server Side application.

In the program.cs I have a check if the application is running in development, production or staging.

if (builder.Environment.IsDevelopment())
{
    Console.WriteLine("##### Running in Development ####");
}
if (builder.Environment.IsProduction())
{
    Console.WriteLine("##### Running in Production ####");
}
if (builder.Environment.IsStaging())
{
    Console.WriteLine("##### Running in Staging ####");
}

I want to display this in my MainLayout.razor.

How would I approach this? Can I parse this somehow or can I access the builder somehow through a service?



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept