BoC.Sitecore.Mvc.SitecoreSpecificResolver.GetService C# (CSharp) Method

GetService() public method

public GetService ( Type serviceType ) : object
serviceType System.Type
return object
        public override object GetService(Type serviceType)
        {
            //sitecore "injects" it's own dependencies in it's controllers (and others), so don't resolve sitecore classes, just construct them
            //now habitat also uses sitecore.* names for their dll's, let's skip those as much as possible
            if (!serviceType.Assembly.FullName.StartsWith("sitecore.feature.", StringComparison.InvariantCultureIgnoreCase)
            && !serviceType.Assembly.FullName.StartsWith("sitecore.foundation.", StringComparison.InvariantCultureIgnoreCase)
            && !serviceType.Assembly.FullName.StartsWith("sitecore.common.", StringComparison.InvariantCultureIgnoreCase)
            && serviceType.Assembly.FullName.StartsWith("sitecore.", StringComparison.InvariantCultureIgnoreCase))
            {
              return Activator.CreateInstance(serviceType);
            }
            return base.GetService(serviceType);
        }