title: Using an optional parameter in C# as an Object
body: <p>i have this code:</p>
  
  <pre><code>public IHttpActionResult Get([FromUri]GetFilesRequest request)
  </code></pre>
  
  <p>If request is <strong>null</strong>, I want to create a new <strong>GetFilesRequest</strong>, because in the constructor I did this to create default params of the class:</p>
  
  <pre><code>public GetFilesRequest()
      {
          Sort = "latest";
          Filter = "";
      }
  </code></pre>
  
  <p>So I'm thinking about:</p>
  
  <pre><code>public IHttpActionResult Get([FromUri]GetFilesRequest request = new GetFilesRequest)
  </code></pre>
  
  <p>But I'm getting this warning:</p>
  
  <pre><code>'request' is of type 'GetFilesRequest'. A default parameter value of a reference type other than string can only be initialized with null.
  </code></pre>