daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. c# Passing type to a child class
  2. public class MyResponse
  3. {
  4.    public MyResult Result{ get; set; }
  5.    public MyResponseHeader ResponseHeader { get; set; }
  6. }
  7.    
  8. public class MyResult
  9. {
  10.    public object[] DocumentList{ get; set; }
  11.    public int NumRecords{ get; set; }
  12.    public int Start{ get; set; }
  13. }
  14.    
  15. public class MyResponse<T>
  16. {
  17.    public MyResult<T> Result{ get; set; }
  18.    public MyResponseHeader ResponseHeader { get; set; }
  19. }
  20.  
  21. public class MyResult<T>
  22. {
  23.    public T[] DocumentList{ get; set; }
  24.    public int NumRecords{ get; set; }
  25.    public int Start{ get; set; }
  26. }
  27.    
  28. var response = MyClient.ExecuteCommand<MyDocument>(request);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top