Skip to content

Instantly share code, notes, and snippets.

@KristianMariyanov
Created February 18, 2020 10:24
Show Gist options
  • Save KristianMariyanov/5ce60d512716d9ea18d242d7e5d07210 to your computer and use it in GitHub Desktop.
Save KristianMariyanov/5ce60d512716d9ea18d242d7e5d07210 to your computer and use it in GitHub Desktop.
public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => { builder.AddDebug(); });
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<WeatherForecastContext>(options =>
options.UseLoggerFactory(MyLoggerFactory)
.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")), ServiceLifetime.Transient);
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddScoped<WeatherForecastService>();
services.AddTelerikBlazor();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment