CB Banhammer web conversion.
This is a simple project, it only has 4 pieces right now
wwwroot
- these files are served directly by the webserver as static files.DataClient.cs
andDataClasses.cs
are responsible for the data layer.Program.cs
is the main function, which is setting up and running the ASP.NET MVC web server. It also has all the controller code for AJAX requests.pages
- These are the Razor C# pages.
I am using Dapper
as a lightweight layer that converts the native ADO.NET API to strongly-typed classes, as defined in DataClasses.cs
.
Each function in the DataClient.cs
is responsible for one 'data action' (typically, one SQL query).
Each page is a pair of files:
page_name.cshtml
- these are the actual HTML pages, which are augmented with the 'model' information, that is taken from the correspondingPageNameModel.cs
files.PageNameModel.cs
- this is the server-side C# code that runs for every request. Typically, theOnGet()
method the model class is calling theDataClient
to fetch the data, and then stores it in some public property, for thecshtml
to render.