// GET api/logentries
        public object Get(string currentLogFolder, string searchTerm, int page, bool reload)
        {
            if (string.IsNullOrEmpty(currentLogFolder))
            {
                return "";
            }

            if (reload == true)
            {
                myLogReader = new LogReader();
            }

            var logFolders = ConfigurationReader.ReadLogFolders();
            var folderEntry = logFolders.FirstOrDefault(x => x.Name == currentLogFolder);

            if (folderEntry == null)
            {
                return "";
            }

            //Load Log Folder (if not already loaded)
            if (myLogReader.LogPathsLoaded.Contains(folderEntry.Path) != true)
            {
                myLogReader.LoadLogFolder(folderEntry.Name, folderEntry.Path);
            }

            var results = myLogReader.GroupedLogEntries.ToList();

            //Apply Search Critera if provided
            if(string.IsNullOrEmpty(searchTerm) != true)
            {
                results = results.Where(x =>
                    x.ErrorMessage.Contains(searchTerm, StringComparison.OrdinalIgnoreCase) ||
                    x.ErrorDetail.Contains(searchTerm, StringComparison.OrdinalIgnoreCase)).ToList();
            }

            int pageCount = results.Count / ITEMSPERPAGE;
            if((results.Count % ITEMSPERPAGE) > 0)
            {
                pageCount++;
            }

            //Apply Paging
            int skip = (page - 1) * ITEMSPERPAGE;
            results = results.Skip(skip).Take(ITEMSPERPAGE).ToList();

            return new
                {
                    Items = results,
                    PageCount = pageCount
                };
        }
 public void MyTestInitialize()
 {
     myLogReader = new LogReader();
 }