Пример #1
0
        public async Task <ResponseResult <T> > InsertEntityAsync(T entity)
        {
            ResponseResult <T> result = new ResponseResult <T>();

            try
            {
                var response = await bounder.Set(entity).InsertEntryAsync();

                if (response != null)
                {
                    result.Model   = response;
                    result.Success = true;
                }
                else
                {
                    result.Success = false;
                    result.Message = "Error";
                }
            }
            catch (WebRequestException ex)
            {
                result.Exception = ex;
                result.Success   = false;
            }
            catch (Exception ex)
            {
                result.Exception = ex;
                result.Success   = false;
            }
            finally
            {
                Dispose();
            }

            return(result);
        }