/// <summary> /// Set options for the middleware /// </summary> /// <param name="configure"></param> /// <returns></returns> public GenericBackendBuilder ConfigureMiddleware(Action <SPMiddlewareOptions> configure) { #if NETFX SPMiddlewareOptions opts = (SPMiddlewareOptions)services.Resolve(typeof(SPMiddlewareOptions)); configure(opts); #else SPMiddlewareOptions opts = (SPMiddlewareOptions)services.First(s => s.ServiceType == typeof(SPMiddlewareOptions)).ImplementationInstance; configure(opts); #endif return(this); }
public object GetService(Type serviceType) { try { return(container.Resolve(serviceType)); } catch (ResolutionFailedException) { return(null); } }
public object Resolve(Type t, string name) { return(_unityContainer.Resolve(t)); }
public TService GetInstance <TService>() { return(Container.Resolve <TService>()); }