Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created April 22, 2021 20:17
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 manoj-choudhari-git/37789aa12b872011f91d93ed25fcb1c0 to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/37789aa12b872011f91d93ed25fcb1c0 to your computer and use it in GitHub Desktop.
Configure Services registering dependencies for a web app
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ICustomLogger, CustomLogger>();
services.AddScoped<IRepository, Repository>();
services.AddControllersWithViews();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment