I have a single purpose website which processes a web-hook and stuffs a parameter into a database.
In other words, no need for the full entity framework.
So what is the simplest possible way to do this?
The entire website is currently written in about 10 lines of code, and I would like to keep it as simple as possible. In other words, I don't want to write the Context and Model. Just a simple insert statement would work for me.
app.Run(async (context) =>
{
string body;
using (StreamReader stream = new StreamReader(context.Request.Body))
{
body = stream.ReadToEnd();
//body = id=12345;
}
if (!String.IsNullOrWhiteSpace(body))
{
var id = StringToDictionary(body).FirstOrDefault(a => a.Key == "Id").Value;
//Stuff ID in a table.
}
await context.Response.WriteAsync("Hello World!");
});
}