Пример #1
0
        /// <summary>
        /// Returns client's IP as detected by Dynali.
        /// </summary>
        /// <returns>string, IP Address</returns>
        public async Task <string> RetrieveMyIpAsync()
        {
            MyIpResponse response = JsonResponse.Parse <MyIpResponse>(await CallAsync(new MyIpAction()));

            if (response.IsSuccessful)
            {
                return(response.Data.Ip);
            }
            throw new DynaliException(response.Code, response.Message);
        }
Пример #2
0
 /// <summary>
 /// Executes provided DynaliAction.
 /// </summary>
 /// <typeparam name="T">JsonResponse deriative</typeparam>
 /// <param name="action">Action details</param>
 /// <returns>JsonResponse deriative</returns>
 protected async Task <T> ExecuteActionAsync <T>(IDynaliAction action) where T : JsonResponse
 {
     return(JsonResponse.Parse <T>(await CallAsync(action)));
 }
Пример #3
0
 /// <summary>
 /// Executes provided DynaliAction.
 /// </summary>
 /// <typeparam name="T">JsonResponse deriative</typeparam>
 /// <param name="action">Action details</param>
 /// <returns>JsonResponse deriative</returns>
 protected T ExecuteAction <T>(IDynaliAction action) where T : JsonResponse
 {
     return(JsonResponse.Parse <T>(Call(action)));
 }