Created
December 13, 2017 14:55
-
-
Save thiagoloureiro/7c2a9203ce14fcaeb4f6a616a8455c7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomerController : NancyModule | |
{ | |
public CustomerController() : base("/customers") | |
{ | |
try | |
{ | |
var obj = new CustomerService(); | |
Get["/"] = _ => | |
{ | |
var ret = obj.ReturnCustomer(); | |
return Response.AsJson(ret); | |
}; | |
Post["/"] = _ => | |
{ | |
obj.UpdateCustomer(); | |
return Response.AsJson("Cleared"); | |
}; | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine(e.Message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment