@@ -818,6 +818,15 @@ public virtual void SendOneWay(string relativeOrAbsoluteUrl, object request)
818818 SendOneWay ( HttpMethods . Post , relativeOrAbsoluteUrl , request ) ;
819819 }
820820
821+ public virtual void SendAllOneWay < TResponse > ( IEnumerable < IReturn < TResponse > > requests )
822+ {
823+ var elType = requests . GetType ( ) . GetElementType ( )
824+ ?? requests . GetType ( ) . GetGenericArguments ( ) . First ( ) ;
825+
826+ var requestUri = this . AsyncOneWayBaseUri . WithTrailingSlash ( ) + elType . Name + "[]" ;
827+ SendOneWay ( HttpMethods . Post , requestUri , requests ) ;
828+ }
829+
821830 public virtual void SendOneWay ( string httpMethod , string relativeOrAbsoluteUrl , object requestDto )
822831 {
823832 var requestUri = GetUrl ( relativeOrAbsoluteUrl ) ;
@@ -839,6 +848,8 @@ public virtual void SendOneWay(string httpMethod, string relativeOrAbsoluteUrl,
839848 {
840849 throw ;
841850 }
851+
852+ using ( response ) { } //auto dispose
842853 }
843854 }
844855
@@ -858,6 +869,16 @@ public virtual Task<HttpWebResponse> SendAsync(IReturnVoid requestDto)
858869 return SendAsync < HttpWebResponse > ( requestDto ) ;
859870 }
860871
872+ public virtual Task < List < TResponse > > SendAllAsync < TResponse > ( IEnumerable < IReturn < TResponse > > requests )
873+ {
874+ var elType = requests . GetType ( ) . GetElementType ( )
875+ ?? requests . GetType ( ) . GetGenericArguments ( ) . First ( ) ;
876+
877+ var requestUri = this . SyncReplyBaseUri . WithTrailingSlash ( ) + elType . Name + "[]" ;
878+
879+ return asyncClient . SendAsync < List < TResponse > > ( HttpMethods . Post , requestUri , requests ) ;
880+ }
881+
861882
862883 public virtual Task < TResponse > GetAsync < TResponse > ( IReturn < TResponse > requestDto )
863884 {
0 commit comments