Ejemplo n.º 1
0
 public ImportModule() : base("/import")
 {
     Get("/tax", _ =>
     {
         try
         {
             var request = this.Bind <RequestObject>();
             if (string.IsNullOrWhiteSpace(request.Path))
             {
                 return(Helper.ErrorResponse(new ArgumentNullException("path", "Please specify source file as query parameter"), HttpStatusCode.BadRequest));
             }
             Taxes.ImportTax(request.Path);
             return(HttpStatusCode.OK);
         }
         catch (Exception e)
         {
             return(Helper.ErrorResponse(e, HttpStatusCode.InternalServerError));
         }
     });
 }