Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2018 12:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Autofac.Builder;
using Autofac.Core;
namespace Autofac.Integration.Web
public class WebFormRegistrationSource : IRegistrationSource
public IEnumerable<IComponentRegistration> RegistrationsFor(Service service, Func<Service, IEnumerable<IComponentRegistration>> registrationAccessor)
if (service is IServiceWithType serviceWithType && serviceWithType.ServiceType.Namespace.StartsWith("ASP", true, CultureInfo.InvariantCulture))
return new[]
return Enumerable.Empty<IComponentRegistration>();
public bool IsAdapterForIndividualComponents => true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment