Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created January 10, 2021 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/68cf857b51556a9dae9ce649cde003b5 to your computer and use it in GitHub Desktop.
Save explorer14/68cf857b51556a9dae9ce649cde003b5 to your computer and use it in GitHub Desktop.
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
// other stuff
ConfigureServices(builder.Services);
await builder.Build().RunAsync();
}
public static void ConfigureServices(IServiceCollection services)
{
services.AddScoped(serviceProvider =>
{
return TraxpenseApiClientFactory.CreateClient(
new BrowserAuthTokenRepository(
serviceProvider.GetService<IJSRuntime>()));
});
//...other services
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment