示例#1
0
        protected virtual IGenericWebApiResult GetLates()
        {
            try
            {
                using (var result = new GenericWebApiResult <T>())
                {
                    result.Data = repo.GetLates() ?? new T();

                    result.Success = true;

                    return(result);
                }
            }
            catch (Exception ex)
            {
                using (var result = new GenericWebApiResult <T>(ex))
                {
                    result.Success = false;
                    dynamic more = new ExpandoObject();
                    more.Errors = ex.Message;
                    result.More = more;

                    return(result);
                }
            }
        }