/// <summary>
        /// Add Cosmos Stack Validation Support
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static IServiceContext AddCosmosValidation(this IServiceContext context)
        {
            using var register = new AspectCoreProxyRegister(context);
            register.RegisterValidation();

            return(context);
        }
Esempio n. 2
0
 /// <summary>
 /// Add repository
 /// </summary>
 /// <param name="context"></param>
 /// <typeparam name="TService"></typeparam>
 /// <returns></returns>
 public static IServiceContext AddCosmosRepository <TService>(this IServiceContext context)
     where TService : class, IRepository
 {
     using var register = new AspectCoreProxyRegister(context);
     register.RegisterRepository <TService>();
     return(context);
 }
Esempio n. 3
0
        /// <summary>
        /// Add CosmosStack FileType Sniffer Support
        /// </summary>
        /// <param name="context"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static IServiceContext AddCosmosFileTypeSniffer(this IServiceContext context, Action <FileTypeSnifferOptions> configure = null)
        {
            using (var register = new AspectCoreProxyRegister(context))
            {
                register.AddFileTypeSniffer(configure);
            }

            return(context);
        }
Esempio n. 4
0
        internal AspectCoreServiceCollection(IServiceContext services, IConfigurationRoot root)
        {
            _configurationBuilder = root is null
                ? new LoggingConfigurationBuilder()
                : new DisabledConfigurationBuilder(root);
            _configurationBuilderLockedStatus = root != null;
            _services     = new AspectCoreProxyRegister(services);
            _settings     = new LoggingOptions();
            _sinkSettings = new Dictionary <string, ILoggingSinkOptions>();
            _additionalEnricherProviders = new List <Func <ILogEventEnricher> >();

            BeGivenConfigurationBuilder = _configurationBuilder.InitializedByGivenBuilder;
            BeGivenConfigurationRoot    = root != null;
        }
Esempio n. 5
0
 /// <summary>
 /// Add Cosmos Data Service
 /// </summary>
 /// <param name="context"></param>
 /// <param name="configure"></param>
 /// <returns></returns>
 public static IServiceContext AddCosmosDataService(this IServiceContext context, Action <DbContextConfig <AspectCoreProxyRegister> > configure = null)
 {
     using var register = new AspectCoreProxyRegister(context);
     register.RegisterDataService(configure);
     return(context);
 }
        /// <summary>
        /// Register Cosmos.I18N for NCC AspectCore
        /// </summary>
        /// <param name="context"></param>
        /// <param name="optionAct"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static II18NServiceCollection AddInternationalizationService(this IServiceContext context, Action <I18NOptions> optionAct = null)
        {
            var register = new AspectCoreProxyRegister(context);

            return(register.AddInternationalizationService <AspectCoreProxyRegister, IServiceContext>(optionAct));
        }
 /// <summary>
 /// I18N service collection
 /// </summary>
 /// <param name="services"></param>
 /// <param name="options"></param>
 public AspectCoreI18NServiceCollection(IServiceContext services = null, I18NOptions options = null)
 {
     _services           = new AspectCoreProxyRegister(services);
     _options            = I18NOptions.Create(options);
     _translationManager = new TranslationManager();
 }