Exemplo n.º 1
0
        public FilterBaseModel()
        {
            var defaultStringOperators = StringOperators.First();

            var defaultDateOperators = NumericOprators.First();

            var defaultNumericOperators = NumericOprators.First(item => item.Equals("=="));

            TraceKey = TraceKey ?? new FilterElements {
                Operator = defaultStringOperators
            };

            //SystemTime = SystemTime ?? new FilterElements { Operator = defaultDateOperators, Operand = System.DateTime.Now.ToString("G") };
            StartDate = StartDate ?? new FilterElements {
                Operator = defaultDateOperators, Operand = System.DateTime.Now.AddMinutes(-5).ToString("G")
            };

            EndDate = EndDate ?? new FilterElements {
                Operator = NumericOprators.First(item => item.Equals("<")), Operand = System.DateTime.Now.AddDays(1).ToString("G")
            };

            Message = Message ?? new FilterElements {
                Operator = defaultStringOperators
            };

            Level = Level ?? new FilterElements {
                Operator = defaultNumericOperators
            };

            Writer = Writer ?? new FilterElements {
                Operator = defaultStringOperators
            };

            Data = new List <KeyValuePair <string, FilterElements> >();
        }