c# - Making a method generic inside an Interface -


I want this method to be implemented, but the implementer wants in his sub-class. This method remains in an interface :

  object GetResponseData (object response);  

I put it in the object, because I thought if I do this, then decide whatever type of incoming response it is, and decide. That's why they want to take this method back. I know I should do what I think is with generic.

The problem with which I air, can be some implementation of this interface, it may not use the HTTPEnd or HTTPRPPonation, this is either a HTPPSpension or in some way a WebClient object Like GetResponseData is completely different from the method ... so I do not know how this is being implemented, I want it to be normal anyway.

GetResponseData logic to remove the data from the feedback stream, deisize it, and then we want the caller to return the data (object).

UPDATED:

This is my interface because it is currently (before your suggestions):

  Public interface IAPIResponse {bool HasResponseErrors {get; } IAPIError [] APIErrors {get; } String ResponseStatusCode {get; } GetResponseData object (HttpWebResponse response); }   

If you do not want to stop the interface itself: < Pre> Tteran Gatorospace & amp; Liter; Tretten, Trapons & gt; (TResponse response);

Or if you want to stop it on an interface and handle different returns and responses, then you want to implement several sections:

  public Interface IGetReponse & lt; TReturn, Trapons & gt; {Trenton GatesSpacedata (Trespope Reps); }  

However, it is worth noting that if you use the first example, you will end up with the duplicated method in that method which can be the interface from it Could that possibly an intangible enforcement be a better way of achieving this?

  Public abstract class GetReponse {Public Abstract Traction GetResponseData & lt; Tretten, Trapons & gt; (TResponse response); }  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -