Example #1
0
 public static IConfigureHost WithSqlStorages(this IConfigureHost host,IDbFactory connection ,Action<StoragesConfiguration> cfgAction)
 {
     cfgAction.MustNotBeNull();
     var cfg=new StoragesConfiguration(host,connection);
     cfgAction(cfg);
     return host;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="hostname"></param>
        /// <param name="branch"></param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">builder</exception>
        /// <exception cref="System.ArgumentException">hostname</exception>
        /// <exception cref="System.ArgumentNullException">branch</exception>
        public static IAppBuilder MapSite(this IAppBuilder builder, string hostname, Action<IAppBuilder> branch)
        {
            builder.MustNotBeNull("builder");
            hostname.MustNotBeNullOrWhitespace("hostname");
            branch.MustNotBeNull("branch");

            return MapSite(builder, new[] { new MapSiteConfig(hostname) }, builder.BranchConfig(branch));
        }
 /// <summary>
 /// Adds a processor which must be configured with the handlers the processor should execute
 /// </summary>
 /// <param name="procs"></param>
 /// <param name="name">Processor name</param>
 /// <param name="cfg">Handlers discovery</param>
 /// <param name="svcCfg"></param>
 /// <returns></returns>
 public static IConfigureProcessors Add(this IConfigureProcessors procs,string name,Action<IConfigureLambdaEndpoint> cfg,Action<IConfigureProcessingService> svcCfg=null)
 {
     cfg.MustNotBeNull();
     var proc=new HostedEndpointConfiguration(name);
     cfg(proc);
     procs.ForEndpoint(proc, svcCfg);
     return procs;
 }
		public IConfigureRoutingConventions Modify(Action<Route, RouteBuilderInfo> modifier)
#endif
        {
            modifier.MustNotBeNull();
            _lambda.Modifier = modifier;
            _parent.Add((IModifyRoute)_lambda);
            return _parent;
        }
 /// <summary>
 /// Registers types with a DI Container using the provided action
 /// </summary>
 /// <param name="typeRegistration">Action which will register a type with the DI Container</param>
 /// <param name="genericTypeRegistration">Action which will register a generic open type with the DI Container</param>
 public static void RegisterInContainer(Action<Type> typeRegistration,Action<Type> genericTypeRegistration)
 {
     typeRegistration.MustNotBeNull();
     genericTypeRegistration.MustNotBeNull();
     typeRegistration(typeof (ValidModelOnlyAttribute));
     Array.ForEach(TypesForDIContainer, genericTypeRegistration);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="siteMapConfigs"></param>
        /// <param name="branch"></param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">builder</exception>
        /// <exception cref="System.ArgumentNullException">siteMapConfigs</exception>
        /// <exception cref="System.ArgumentNullException">branch</exception>
        public static IAppBuilder MapSite(this IAppBuilder builder, IEnumerable<MapSiteConfig> siteMapConfigs, Action<IAppBuilder> branch)
        {
            builder.MustNotBeNull("builder");
            siteMapConfigs.MustNotBeNull("siteMapConfigs");
            branch.MustNotBeNull("branch");

            return MapSite(builder, siteMapConfigs, builder.BranchConfig(branch));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="mapSiteConfig"></param>
        /// <param name="branch"></param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">builder</exception>
        /// <exception cref="System.ArgumentNullException">MapSiteConfig</exception>
        /// <exception cref="System.ArgumentNullException">branch</exception>
        public static IAppBuilder MapSite(this IAppBuilder builder, MapSiteConfig mapSiteConfig, Action<IAppBuilder> branch)
        {
            builder.MustNotBeNull("builder");
            mapSiteConfig.MustNotBeNull("MapSiteConfig");
            branch.MustNotBeNull("branch");

            return MapSite(builder, mapSiteConfig, builder.BranchConfig(branch));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="hostname"></param>
        /// <param name="requestScheme"></param>
        /// <param name="branch"></param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">builder</exception>
        /// <exception cref="System.ArgumentException">hostname</exception>
        /// <exception cref="System.ArgumentNullException">branch</exception>
        public static IAppBuilder MapSite(this IAppBuilder builder, string hostname, RequestScheme requestScheme, Action<IAppBuilder> branch)
        {
            builder.MustNotBeNull("builder");
            hostname.MustNotBeNullOrWhitespace("hostname");
            branch.MustNotBeNull("branch");

            return MapSite(builder, hostname, requestScheme, builder.BranchConfig(branch));
        }
Example #9
0
 public IConfigureCommand WithCommandOptions(Action<DbCommand> options)
 {
     options.MustNotBeNull();
     ApplyOptions = options;
     return this;
 }