public BillingModule(IBillingService billingService) : base("/billing") { Get["/{id}"] = parameters => { Bill result = billingService.Get(parameters.id); return Response.AsJson(result); }; }
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 })); } }