예제 #1
0
 public BillingModule(IBillingService billingService)
     : base("/billing")
 {
     Get["/{id}"] = parameters =>
     {
         Bill result = billingService.Get(parameters.id);
         return Response.AsJson(result);
     };
 }
예제 #2
0
 public async Task <ActionResult <dynamic> > Get([FromQuery] DateTime?from, [FromQuery] DateTime?to)
 {
     try
     {
         return(Ok(await billingService.Get(from.GetValueOrDefault(), to.GetValueOrDefault())));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, new {
             Error = ex.Message
         }));
     }
 }