public static async Task ReadBodyAsJsonAsync()

in libraries/Extensions.cs [17:36]


        public static async Task<T> ReadBodyAsJsonAsync<T>(this ReceiveResponse response)
        {
            // The first stream attached to a ReceiveRequest is always the ReceiveRequest body.
            // Any additional streams must be defined within the body or they will not be
            // attached properly when processing activities.
            try
            {
                T returnValue = default(T);
                string streamContent = await response.ReadBodyAsStringAsync().ConfigureAwait(false);
                if (streamContent != null)
                {
                    returnValue = JsonConvert.DeserializeObject<T>(streamContent);
                }
                return returnValue;
            }
            catch (Exception)
            {
                throw;
            }
        }