I've been playing around with .net core 2.1 and I am trying to get a better understanding of the server architecture that it runs. I am trying to use it in a similar way to how Node and Express can be used to render views based on http requests. Kind of like this:
router.get("/events", function(req,res){
DBhandler.GetEvents(req,res, function(events){
res.render("events.ejs", {events:events});
})
});
Can you use .net core in a similar way without going through the baked in MVC pattern?
I've been testing with .net core by doing the following in my Startup class:
app.Run(async context =>
{
await context.Response.WriteAsync(DataHelper.GetCompetitions(context.Request.QueryString.ToString()));
});
I want a setup where my GetData would actually return a fully formatted razor page or generally speaking a "view" of some sort, similar to how that can be done in Node and Express using a view engine like the first code snippet.
Are there any use cases for this type of architecture for .net? Again I'm just experimenting and trying to learn the architecture without totally relying on everything that is baked in.