示例#1
0
        public virtual IGenericWebApiResult DynamicData(string term)
        {
            try
            {
                using (var result = new GenericWebApiResult <dynamic>())
                {
                    result.Data = repo.DynamicData(term);
                    if (result.Data == null)
                    {
                        throw new Exception(BaseConstants.MESSAGE_DATA_IS_NOT_EXIST);
                    }

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

                    return(result);
                }
            }
        }