title: c# Generic property
body: <p>I am trying to make a class in C# that can be used to return data of any types. </p>
  
  <pre><code>public class ResponseObject
  {
      public &lt;T&gt; data { get;set }
      public Boolean Success { get; set; }
      public string Message { get; set; } 
  }
  </code></pre>
  
  <p>The Object will be a wrapper for the response object when my application sends a request to the API.</p>
  
  <p>i have tried researching this but cannot find any tutorials which are relevant to what i am trying to do.</p>
  
  <p>Is this possible in C#? the Response Object will be converted to a JSON string and then sent as a response.</p>
  
  <p>I will not be doing any processing of this object as that will already by done. I just want to place the data inside the ResponseObject and send it</p>
  
  <p>I want to do something along the lines of:</p>
  
  <pre><code>var customers = repository.GetCustomers();
  var orders = repository.GetOrders();
  if(customers)
  {
    success = true;
    message = "";
  }
  else{
     success = false;
     message = "failed to get customers";
  }
  if(orders)
  {
    orderssuccess = true;
    ordersmessage = "";
  }
  else{
     orderssuccess = false;
     ordersmessage = "failed to get orders";
  }
  ResponseObject customerResponse = new ResponseObject{
      data = customers,
      success = success,
      message = message 
  };
  ResponseObject orderResponse = new ResponseObject{
      data = orders,
      success = orderssuccess,
      message = ordersmessage 
  };
  </code></pre>