Пример #1
0
        public Task<Result> Remove(Firebase reference)
        {
            CheckDisposed();
            ArgUtils.CheckForNull(reference, nameof(reference));

            var request = new Request(reference, HttpMethod.Delete);
            return PerformRequest(request);
        }
Пример #2
0
        public Task<Result> Set(Firebase reference, object content)
        {
            CheckDisposed();

            ArgUtils.CheckForNull(reference, nameof(reference));
            ArgUtils.CheckForNull(content, nameof(content));

            var request = new Request(reference, HttpMethod.Put, content);
            return PerformRequest(request);
        }
Пример #3
0
 private async Task<Result> PerformRequest(Request request)
 {
     try
     {
         HttpRequestMessage requestMessage = request.CreateRequestMessage(Context);
         HttpResponseMessage httpResponseMessage = await SendRequestMessage(requestMessage);
         return request.CreateResult(httpResponseMessage, Context);
     }
     catch (Exception ex)
     {
         return new Result(new FirebaseException(ex.Message, ex));
     }
 }