Ejemplo n.º 1
0
 public IHttpActionResult GetEventsBySite(string site,
                                          [FromUri(Name = "startDate")] DateTime startDate, [FromUri(Name = "endDate")] DateTime endDate)
 {
     return(Authorized(token => {
         try
         {
             return Ok(_eventService.GetEventsBySite(site, token, startDate, endDate));
         }
         catch (Exception e)
         {
             var apiError = new ApiErrorDto("GetEventsBySite failed for Site=" + site, e);
             throw new HttpResponseException(apiError.HttpResponseMessage);
         }
     }));
 }