public BootModelToDomainConverter(IBootBuilder builder) { _builder = builder; }
/// <summary> /// Disables logging. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder NoLogging(this IBootBuilder bootBuilder) { bootBuilder.Set <LoggingSettings>(_ => _.DisableLogging, true); return(bootBuilder); }
/// <summary> /// Define which container to be used during application lifecycle. /// </summary> /// <param name="bootBuilder">The <see cref="IBootBuilder"/>.</param> /// <typeparam name="T"><see cref="Type"/> of <see cref="IContainer">container</see>.</typeparam> /// <returns>Chained <see cref="Bootloader"/> for configuration.</returns> /// <remarks> /// This is normally discovered using the interface <see cref="ICanProvideContainer"/> /// but in some cases you might need to be explicit, e.g. when you have a wrapper around /// the actual container. /// </remarks> public static IBootBuilder UseContainer <T>(this IBootBuilder bootBuilder) where T : IContainer { bootBuilder.Set <ContainerSettings>(_ => _.ContainerType, typeof(T)); return(bootBuilder); }
/// <summary> /// Set the log message writer creators to use. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="creators">The instances of <see cref="ILogMessageWriterCreator"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseLogMessageWriterCreators(this IBootBuilder bootBuilder, params ILogMessageWriterCreator[] creators) { bootBuilder.Set <LoggingSettings>(_ => _.LogMessageWriterCreators, creators); return(bootBuilder); }
/// <summary> /// Set <see cref="ILoggerFactory"/> to use. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="loggerFactory"><see cref="ILoggerFactory"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseLoggerFactory(this IBootBuilder bootBuilder, ILoggerFactory loggerFactory) { bootBuilder.Set <LoggingSettings>(_ => _.LogMessageWriterCreators, new[] { new LogMessageWriterCreator(loggerFactory) }); return(bootBuilder); }
/// <summary> /// Set <see cref="ILoggerFactory"/> to use. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="loggerFactory"><see cref="ILoggerFactory"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseLoggerFactory(this IBootBuilder bootBuilder, ILoggerFactory loggerFactory) { bootBuilder.Set <LoggingSettings>(_ => _.LoggerFactory, loggerFactory); return(bootBuilder); }
/// <summary> /// With a set of known <see cref="AssemblyName">assemblies</see> /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build</param> /// <param name="assemblies"><see cref="IEnumerable{T}"/> of <see cref="AssemblyName"/> to use as well known assemblies, instead of discovering</param> /// <returns>Chained <see cref="BootBuilder"/></returns> public static IBootBuilder WithAssemblies(this IBootBuilder bootBuilder, IEnumerable <AssemblyName> assemblies) { bootBuilder.Set <DiscoverySettings>(_ => _.AssemblyProvider, new WellKnownAssembliesAssemblyProvider(assemblies)); return(bootBuilder); }
/// <summary> /// Skip any <see cref="ICanPerformBootProcedure">boot procedures</see> /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build</param> /// <returns>Chained <see cref="BootBuilder"/></returns> public static IBootBuilder SkipBootprocedures(this IBootBuilder bootBuilder) { bootBuilder.Set <BootProceduresSettings>(_ => _.Enabled, false); return(bootBuilder); }
/// <summary> /// Set scheduling to be synchronous. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="assembly"><see cref="Assembly"/> to use as entry assembly.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> /// <remarks> /// If an entry assembly is not specified, the system will use the <see cref="Assembly.GetEntryAssembly()"/> method. /// </remarks> public static IBootBuilder WithEntryAssembly(this IBootBuilder bootBuilder, Assembly assembly) { bootBuilder.Set <BasicsSettings>(_ => _.EntryAssembly, assembly); return(bootBuilder); }
/// <summary> /// Use a specific <see cref="IFileSystem"/>. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="fileSystem"><see cref="IFileSystem"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseFileSystem(this IBootBuilder bootBuilder, IFileSystem fileSystem) { bootBuilder.Set <InitialSystemSettings>(_ => _.FileSystem, fileSystem); return(bootBuilder); }
/// <summary> /// Use a specific <see cref="ISystemClock"/>. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="systemClock"><see cref="ISystemClock"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseSystemClock(this IBootBuilder bootBuilder, ISystemClock systemClock) { bootBuilder.Set <InitialSystemSettings>(_ => _.SystemClock, systemClock); return(bootBuilder); }
/// <summary> /// Set scheduling to be synchronous. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> /// <remarks> /// Asynchronous scheduling is default. /// </remarks> public static IBootBuilder SynchronousScheduling(this IBootBuilder bootBuilder) { bootBuilder.Set <InitialSystemSettings>(_ => _.Scheduler, new SyncScheduler()); return(bootBuilder); }
public BootModelToDomainProfile(IBootBuilder builder) { _builder = builder; }
/// <summary> /// With a custom <see cref="ICanProvideAssemblies"/> /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build</param> /// <param name="assemblyProvider">An <see cref="ICanProvideAssemblies">assembly provider</see> instance</param> /// <returns>Chained <see cref="BootBuilder"/></returns> public static IBootBuilder WithAssemblyProvider(this IBootBuilder bootBuilder, ICanProvideAssemblies assemblyProvider) { bootBuilder.Set <DiscoverySettings>(_ => _.AssemblyProvider, assemblyProvider); return(bootBuilder); }
/// <summary> /// Set <see cref="ILogAppender"/> to use. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="logAppender"><see cref="ILogAppender"/> to use.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseLogAppender(this IBootBuilder bootBuilder, ILogAppender logAppender) { bootBuilder.Set <LoggingSettings>(_ => _.LogAppender, logAppender); return(bootBuilder); }
/// <summary> /// Set <see cref="Environment"/> to development - default is production. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder Development(this IBootBuilder bootBuilder) { bootBuilder.Set <BasicsSettings>(_ => _.Environment, Environment.Development); return(bootBuilder); }
/// <summary> /// Sets the default logger for all environments. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder UseDefaultLoggerInAllEnvironments(this IBootBuilder bootBuilder) { bootBuilder.Set <LoggingSettings>(_ => _.UseDefaultInAllEnvironments, true); return(bootBuilder); }
/// <summary> /// With a set of known <see cref="AssemblyName">assemblies</see> /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build</param> /// <param name="assembly"><see cref="Assembly"/> that holds the embedded resource with assemblies in it</param> /// <returns>Chained <see cref="BootBuilder"/></returns> public static IBootBuilder WithAssembliesSpecifiedIn(this IBootBuilder bootBuilder, Assembly assembly) { bootBuilder.Set <DiscoverySettings>(_ => _.AssemblyProvider, new EmbeddedResourceAssembliesAssemblyProvider(assembly)); return(bootBuilder); }
/// <summary> /// Disables logging. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder NoLogging(this IBootBuilder bootBuilder) { bootBuilder.Set <LoggingSettings>(_ => _.Logger, new NullLogger()); return(bootBuilder); }
/// <summary> /// Include assemblies that start with a certain name in the discovery. /// </summary> /// <param name="bootBuilder"><see cref="BootBuilder"/> to build.</param> /// <param name="names">Params of names to include.</param> /// <returns>Chained <see cref="BootBuilder"/>.</returns> public static IBootBuilder IncludeAssembliesStartingWith(this IBootBuilder bootBuilder, params string[] names) { bootBuilder.Set <DiscoverySettings>(_ => _.IncludeAssembliesStartWith, names); return(bootBuilder); }