diff --git a/CustomizedRequestMessage.cs b/CustomizedRequestMessage.cs index 4cff133..19a815e 100644 --- a/CustomizedRequestMessage.cs +++ b/CustomizedRequestMessage.cs @@ -1,13 +1,13 @@ +using System.Net; using Microsoft.OData.Client; namespace OData4 { public class CustomizedRequestMessage : HttpWebRequestMessage { - public CustomizedRequestMessage(DataServiceClientRequestMessageArgs args) - : base(args) + public CustomizedRequestMessage(DataServiceClientRequestMessageArgs args, IWebProxy webProxy) : base(args) { - HttpWebRequest.Proxy = LINQPad.Util.GetWebProxy(); + HttpWebRequest.Proxy = webProxy; } } } \ No newline at end of file diff --git a/OData4DynamicDriver.cs b/OData4DynamicDriver.cs index c3f5eae..148ff7a 100644 --- a/OData4DynamicDriver.cs +++ b/OData4DynamicDriver.cs @@ -281,11 +281,12 @@ public override void InitializeContext(IConnectionInfo cxInfo, object context, Q { var dsContext = (DataServiceContext)context; - dsContext.Credentials = cxInfo.GetConnectionProperties().GetCredentials(); + var properties = cxInfo.GetConnectionProperties(); + dsContext.Credentials = properties.GetCredentials(); dsContext.Configurations.RequestPipeline.OnMessageCreating += args => { - var message = new CustomizedRequestMessage(args); + var message = new CustomizedRequestMessage(args, properties.GetWebProxy()); return message; };