コード例 #1
0
        protected override void Validate()
        {
            if (ConnectionString == null)
            {
                throw new ArgumentNullException(nameof(ConnectionString));
            }

            if (ConnectionString.Length == 0)
            {
                throw new ArgumentException("连接字符串{0}不能为空".With(nameof(ConnectionString)), nameof(ConnectionString));
            }

            LogstashUri.For(ConnectionString).Validate();

            if (MaxConcurrent == 0)
            {
                throw  new ArgumentOutOfRangeException(nameof(MaxConcurrent), "最大并发数必须大于0");
            }
        }
コード例 #2
0
 public static ILogRepository Create(string connectionString, int maxConcurrent)
 {
     return(new CLogRepository(LogstashUri.For(connectionString), new RestHttpClientHelper()));
 }