Пример #1
0
        public void query_via_application_and_return_entry()
        {
            repo.Add(Helper.makeEntry(Application: "App1"));
            repo.Add(Helper.makeEntry(Application: "App2"));

            Assert.AreEqual(2, repo.Count());

            Entry[] actual = repo.Query(EntryFilter.ApplicationFilter("App1"));

            Assert.AreEqual(1, actual.Length);
            Assert.AreEqual("App1", actual[0].Application);
        }
Пример #2
0
        public Predicate <Entry>[] Filter()
        {
            List <Predicate <Entry> > Result = new List <Predicate <Entry> >();

            if (!string.IsNullOrEmpty(Application))
            {
                Result.Add(EntryFilter.ApplicationFilter(Application));
            }
            if (!string.IsNullOrEmpty(Message))
            {
                Result.Add(EntryFilter.MessageFilter(Message));
            }
            if (Messageclass != null)
            {
                Result.Add(EntryFilter.MessageclassFilter(Messageclass));
            }

            DateTime Enddate = LogdateTo == DateTime.MinValue ? DateTime.MaxValue : LogdateTo;

            Result.Add(EntryFilter.LogdateFilter(LogdateFrom, Enddate));

            return(Result.ToArray());
        }