////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Enumerates the items in this collection that meet given criteria. </summary>
        ///
        /// <remarks>   Mustafa SAÇLI, 9.05.2019. </remarks>
        ///
        /// <param name="startTimestamp">   The start timestamp. </param>
        /// <param name="endTimestamp">     The end timestamp. </param>
        ///
        /// <returns>   An enumerator that allows foreach to be used to process the matched items. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public IEnumerable <ErrorLogModel> Search(long?startTimestamp, long?endTimestamp)
        {
            var result = new ErrorLogModel[] { }.AsEnumerable();

            try
            {
                result = logBusiness.GetLogs(startTimestamp, endTimestamp);
            }
            catch (Exception e)
            {
                SimpleFileLogger.Instance.LogError(e);
            }

            result = result ?? new ErrorLogModel[] { }.AsEnumerable();

            return(result);
        }
Пример #2
0
        public IHttpActionResult Search(long?startTimestamp, long?endTimestamp)
        {
            var result = new ErrorLogModel[] { }.AsEnumerable();

            try
            {
                result = logBusiness.GetLogs(startTimestamp, endTimestamp);
            }
            catch (Exception e)
            {
                this.Logger?.LogError(e);
            }

            result = result ?? new ErrorLogModel[] { }.AsEnumerable();

            return(Ok(result));
        }