示例#1
0
文件: Core.cs 项目: crazyants/nCubed
        public static void Initialize(TestContext tc)
        {
            shimsContext = ShimsContext.Create();

            N3Section n3Section = new N3Section();

            n3Section.System = new SystemSection();
            n3Section.System.RetryConfiguration = new Configurations.Common.Sections.RetrySection();

            n3Section.System.RetryConfiguration.ProcessConfiguration                = new Configurations.Common.Sections.Retries.ProcessRetrySection();
            n3Section.System.RetryConfiguration.ProcessConfiguration.RetryName      = "Retry";
            n3Section.System.RetryConfiguration.ProcessConfiguration.RetryCount     = 3;
            n3Section.System.RetryConfiguration.ProcessConfiguration.RetryInterval  = 10;
            n3Section.System.RetryConfiguration.ProcessConfiguration.FirstFastRetry = true;

            n3Section.System.RetryConfiguration.DatabaseConfiguration                  = new Configurations.Common.Sections.Retries.DatabaseRetrySection();
            n3Section.System.RetryConfiguration.DatabaseConfiguration.RetryName        = "Retry";
            n3Section.System.RetryConfiguration.DatabaseConfiguration.RetryCount       = 3;
            n3Section.System.RetryConfiguration.DatabaseConfiguration.InitialRetry     = 1;
            n3Section.System.RetryConfiguration.DatabaseConfiguration.IncrementalRetry = 1;
            n3Section.System.RetryConfiguration.DatabaseConfiguration.FirstFastRetry   = true;

            n3Section.System.RetryConfiguration.MessagingConfiguration.RetryName      = "Retry";
            n3Section.System.RetryConfiguration.MessagingConfiguration.RetryCount     = 3;
            n3Section.System.RetryConfiguration.MessagingConfiguration.MinBackOff     = 1;
            n3Section.System.RetryConfiguration.MessagingConfiguration.MaxBackOff     = 3;
            n3Section.System.RetryConfiguration.MessagingConfiguration.FirstFastRetry = true;

            ShimConfigurationManager.GetSectionString = (name) =>
            {
                return(n3Section as ConfigurationSection);
            };
        }
示例#2
0
 /// <summary>
 /// Public constructor for store core related errors.
 /// </summary>
 public CoreErrorEventSource()
 {
     try
     {
         N3Section section = ConfigurationManager.GetSection(N3Section.N3_NAME) as N3Section;
         CoreErrorEventSource.SetCurrentThreadActivityId(section.System.ActivityId);
     }
     catch (System.NullReferenceException nre)
     {
         throw new ArgumentNullException(Resources.ExceptionSystemConfigurationMissing, nre);
     }
 }
示例#3
0
        /// <summary>
        /// Base cosntructor.
        /// </summary>
        public DbCommonConfiguration()
        {
            N3Section nCubedConfiguration = (ConfigurationManager.GetSection(N3Section.N3_NAME) as N3Section);

            //TODO: ¿Cómo afecta a la opción por código?
            SetExecutionStrategy(SqlProviderServices.ProviderInvariantName, () => new SqlDbExecutionStrategy());

            SetDefaultConnectionFactory(new ServiceConfigurationSettingConnectionFactory());

            if (nCubedConfiguration.System.DatabaseConfiguration.LogSql)
            {
                DbInterception.Add(new InterceptorLogging());
            }
        }
示例#4
0
        /// <summary>
        /// Public constructor for store CQRS related events.
        /// </summary>
        public CQRSErrorEventSource()
        {
            N3Section section = ConfigurationManager.GetSection(N3Section.N3_NAME) as N3Section;

            CQRSErrorEventSource.SetCurrentThreadActivityId(section.CQRS.ActivityId);
        }
示例#5
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        public DatabaseLoggingEventSource()
        {
            N3Section section = ConfigurationManager.GetSection(N3Section.N3_NAME) as N3Section;

            DatabaseLoggingEventSource.SetCurrentThreadActivityId(section.System.DatabaseConfiguration.ActivityId);
        }
        /// <summary>
        /// Public constructor for store core related events.
        /// </summary>
        public FrameworkLoggingEventSource()
        {
            N3Section section = ConfigurationManager.GetSection(N3Section.N3_NAME) as N3Section;

            FrameworkLoggingEventSource.SetCurrentThreadActivityId(section.System.LogId);
        }