Exemple #1
0
 /// <summary>
 /// Configures the Apworks framework by using the default settings: the default application instance, the default
 /// identity generator and the default sequence generator.
 /// </summary>
 /// <param name="configurator">The <see cref="IApworksConfigurator"/> instance to be extended.</param>
 /// <returns>The <see cref="ISequenceGeneratorConfigurator"/> instance.</returns>
 public static ISequenceGeneratorConfigurator WithDefaultSettings(this IApworksConfigurator configurator)
 {
     return(WithDefaultSequenceGenerator(
                WithDefaultIdentityGenerator(
                    WithDefaultApplication(configurator))));
 }
 /// <summary>
 /// Configures the Apworks framework by using Unity as the object container and other settings by default.
 /// </summary>
 /// <param name="configurator">The <see cref="IApworksConfigurator"/> instance to be extended.</param>
 /// <param name="containerInitFromConfigFile">The <see cref="System.Boolean"/> value which indicates whether the container configuration should be read from the config file.</param>
 /// <param name="containerConfigSectionName">The name of the section in the config file. This value must be specified when the <paramref name="containerInitFromConfigFile"/> parameter is set to true.</param>
 /// <returns>The <see cref="IObjectContainerConfigurator"/> instace.</returns>
 public static IObjectContainerConfigurator UsingUnityContainerWithDefaultSettings(this IApworksConfigurator configurator, bool containerInitFromConfigFile = false, string containerConfigSectionName = null)
 {
     return(configurator.WithDefaultSettings().UsingUnityContainer(containerInitFromConfigFile, containerConfigSectionName));
 }
Exemple #3
0
 /// <summary>
 /// Configures the Apworks framework by using the specified application object.
 /// </summary>
 /// <typeparam name="TApplication">The type of the application object.</typeparam>
 /// <param name="configurator">The <see cref="IApworksConfigurator"/> instance to be extended.</param>
 /// <returns>The <see cref="IApplicationConfigurator"/> instance.</returns>
 public static IApplicationConfigurator WithApplication <TApplication>(this IApworksConfigurator configurator)
     where TApplication : IApp
 {
     return(new ApplicationConfigurator(configurator, typeof(TApplication)));
 }
Exemple #4
0
 /// <summary>
 /// Configures the Apworks framework by using the default application instance.
 /// </summary>
 /// <param name="configurator">The <see cref="IApworksConfigurator"/> instance to be extended.</param>
 /// <returns>The <see cref="IApplicationConfigurator"/> instance.</returns>
 public static IApplicationConfigurator WithDefaultApplication(this IApworksConfigurator configurator)
 {
     return(WithApplication <App>(configurator));
 }
Exemple #5
0
 public static IHalSupportConfigurator WithHalSupport <THalBuildConfiguration>(this IApworksConfigurator configurator, Func <IServiceProvider, THalBuildConfiguration> halBuildConfigurationFactory, ServiceLifetime serviceLifeTime = ServiceLifetime.Scoped)
     where THalBuildConfiguration : class, IHalBuildConfiguration
 {
     return(new HalSupportConfigurator <THalBuildConfiguration>(configurator, halBuildConfigurationFactory, serviceLifeTime));
 }
Exemple #6
0
 public static IDataServiceConfigurator WithDataServiceSupport(this IApworksConfigurator configurator, DataServiceConfigurationOptions options)
 {
     return(new DataServiceConfigurator(configurator, options));
 }
Exemple #7
0
 public static IRepositoryConfigurator WithRepository(this IApworksConfigurator configurator, Func <IServiceProvider, IRepositoryContext> repositoryContextFactory, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
 {
     return(new RepositoryConfigurator <IRepositoryContext>(configurator, repositoryContextFactory, serviceLifetime));
 }
Exemple #8
0
 public static IRepositoryConfigurator WithRepository(this IApworksConfigurator configurator, IRepositoryContext repositoryContext, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
 {
     return(new RepositoryConfigurator <IRepositoryContext>(configurator, repositoryContext, serviceLifetime));
 }
Exemple #9
0
 /// <summary>
 /// Adds the Hypertext Application Language (HAL) support to the Apworks application.
 /// </summary>
 /// <typeparam name="THalBuildConfiguration">The type of the HAL build configuration.</typeparam>
 /// <param name="configurator">The <see cref="IApworksConfigurator"/> which configures the Apworks application.</param>
 /// <param name="halBuildConfiguration">The <see cref="IHalBuildConfiguration"/> instance which defines the logic of building the HAL resource.</param>
 /// <param name="serviceLifetime">The service lifetime which represents the lifetime of the registered HAL build configuration.</param>
 /// <returns>The <see cref="IHalSupportConfigurator"/> which configures the Apworks application.</returns>
 public static IHalSupportConfigurator WithHalSupport <THalBuildConfiguration>(this IApworksConfigurator configurator, THalBuildConfiguration halBuildConfiguration, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
     where THalBuildConfiguration : class, IHalBuildConfiguration
 {
     return(new HalSupportConfigurator <THalBuildConfiguration>(configurator, halBuildConfiguration, serviceLifetime));
 }