/// <summary>
        /// Queries the exception information.
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public List <ExceptionInfo> QueryExceptionInfo(ExceptionCriteria criteria)
        {
            try
            {
                criteria.CheckNullObject(nameof(criteria));

                using (var controller = new ExceptionInfoAccessController(_sqlConnectionString))
                {
                    return(controller.QueryException(criteria));
                }
            }
            catch (Exception ex)
            {
                throw ex.Handle(new { criteria });
            }
        }
        /// <summary>
        /// Logs the exception.
        /// </summary>
        /// <param name="exceptionInfo">The exception information.</param>
        public void LogException(ExceptionInfo exceptionInfo)
        {
            try
            {
                exceptionInfo.CheckNullObject(nameof(exceptionInfo));

                using (var controller = new ExceptionInfoAccessController(_sqlConnectionString))
                {
                    controller.LogException(exceptionInfo);
                }
            }
            catch (Exception ex)
            {
                throw ex.Handle(new { exceptionInfo });
            }
        }
        /// <summary>
        /// Gets the exception by key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        public ExceptionInfo GetExceptionByKey(Guid?key)
        {
            try
            {
                key.CheckNullObject(nameof(key));

                using (var controller = new ExceptionInfoAccessController(_sqlConnectionString))
                {
                    return(controller.QueryException(new ExceptionCriteria {
                        Key = key
                    }).FirstOrDefault());
                }
            }
            catch (Exception ex)
            {
                throw ex.Handle(new { key });
            }
        }