Skip to content

Instantly share code, notes, and snippets.

@NickPolyder
Created December 11, 2020 15:59
Show Gist options
  • Save NickPolyder/e52f6e603e63df0bd16c02da1cbeb0da to your computer and use it in GitHub Desktop.
Save NickPolyder/e52f6e603e63df0bd16c02da1cbeb0da to your computer and use it in GitHub Desktop.
Making A ServiceCollection Extensions
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
public static class ExampleExtensions
{
public static IServiceCollection AddExampleService(this IServiceCollection services)
{
services.AddSingleton<IExampleService, ExampleService>();
return services;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment