SlickOne.Biz.Service.WfDataService.GetLogList C# (CSharp) Method

GetLogList() public method

获取日志
public GetLogList ( ) : IList
return IList
        public IList<LogEntity> GetLogList()
        {
            var sql = @"SELECT TOP 100
                            ID,
                            EventTypeID,
                            Priority,
                            Severity,
                            Title,
                            LEFT(Message, 20),
                            Timestamp
                        FROM WfLog
                        ORDER BY ID DESC";
            var list = QuickRepository.Query<LogEntity>(sql).ToList();
            return list;
        }

Usage Example

Example #1
0
        public ResponseResult<List<LogEntity>> GetLogList()
        {
            var result = ResponseResult<List<LogEntity>>.Default();
            try
            {
                var wfService = new WfDataService();
                var entity = wfService.GetLogList().ToList();

                result = ResponseResult<List<LogEntity>>.Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult<List<LogEntity>>.Error(
                    string.Format("读取{0}数据失败, 错误:{1}", "Log", ex.Message)
                );
            }
            return result;
        }