Exemplo n.º 1
0
        private bool UpdateResource <T>(T competition, string resourceUri) where T : class
        {
            this.LastApiMessage = string.Empty;

            StatusMessage message;
            RestAdapter   adapter = GetAdapter();

            try
            {
                message = adapter.Put <T>(new Uri(this.apiUriBase + resourceUri), competition);
            }
            catch (Exception ex)
            {
                throw new ApiException(ex);
            }
            finally
            {
                ReleaseAdapter(adapter);
            }


            this.LastApiMessage = message.Message;
            return(message.Code == (int)HttpStatusCode.OK);
        }