private static IServiceRegistrar Register(this IServiceRegistrar serviceRegistrar, Type serviceType, Type implementationType, RegistrationScope registrationScope) { switch (registrationScope) { case RegistrationScope.Singleton: return(serviceRegistrar.AddSingleton(serviceType, implementationType)); case RegistrationScope.Scoped: return(serviceRegistrar.AddScoped(serviceType, implementationType)); case RegistrationScope.Transient: return(serviceRegistrar.AddTransient(serviceType, implementationType)); default: break; } return(serviceRegistrar); }