title: How to pass DateTimeOffset parameters to oData functions
body: <p>I have an odata function called GetForPeriod defined as:</p>
  
  <pre><code>        var getForPeriod =
              builder.EntityType&lt;EventModel&gt;()
                  .Collection
                  .Function("GetForPeriod")
                  .ReturnsCollection&lt;EventModelSummary&gt;();
          getForPeriod.Parameter&lt;DateTimeOffset&gt;("from");
          getForPeriod.Parameter&lt;DateTimeOffset&gt;("to");
  </code></pre>
  
  <p>So to get results from the function, I need to call:</p>
  
  <p><code>http://localhost:17257/odata/Events/Default.GetForPeriod(from=2015-12-27T00:00:00-06:00,to=2016-02-06T00:00:00-06:00)</code></p>
  
  <p>But I keep getting an error stating:</p>
  
  <blockquote>
    <p>A potentially dangerous Request.Path value was detected from the client (:).</p>
  </blockquote>
  
  <p>The problem is the dates, as if I do 
  <code>http://localhost:17257/odata/Events/Default.GetForPeriod(from=null,to=null)</code>
  I get an error stating that it can't convert null to a DateTimeOffset (which makes sense).</p>
  
  <p>I tried replacing the colon (:) in the from and two values to <strong>%3A</strong>, but I still get the same dangerous path error. </p>
  
  <p>Interesting enough, if I call the read path for events with a date filter it works fine.
  <code>http://localhost:17257/odata/Events?$filter=ScheduledDate%20ge%202015-12-27T00:00:00-06:00%20and%20ScheduledDate%20le%202016-02-06T00:00:00-06:00</code></p>
  
  <p>How am I supposed to call an OData function which takes a datetime offset for a parameter?</p>