示例#1
0
 public virtual async Task <TSubResponseResource> PostAsync <TSubResource, TSubResponseResource>(Action <TSubResource> postAction,
                                                                                                 Action
                                                                                                 <
                                                                                                     IRequestOptions
                                                                                                     <TSubResponseResource> > options)
     where TSubResource : class, TResource where TSubResponseResource : TPostResponseResource
 {
     return((TSubResponseResource)await Client.PostAsync(Uri, postAction, RequestOptions.Create(options)));
 }
示例#2
0
        internal static Task <object> PostAsync <T>(this IPomonaClient client, string uri, Action <T> postAction, RequestOptions options)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }
            var postForm = client.TypeMapper.CreatePostForm(typeof(T));

            postAction((T)postForm);
            return(client.PostAsync(uri, postForm, options));
        }