-
November 25th, 2010, 02:06 AM
#1
overriding the same method without code duplication
Hi !
I have several web references in my project .
I created a new class that inherit from those web reference class and I override GetWebResponse from each of those web reference class.
For instance
public class UserServiceProxy : .UserService
{
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion = HttpVersion.Version10;
return webRequest;
}
}
How do it prevent code repetition like this in every proxy class that inherit from the web reference
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|