CodeFirstWebFramework 1.3.24

Easy to use web server for building web apps that use sql databases generated automatically from c# classes.

Install-Package CodeFirstWebFramework -Version 1.3.24
dotnet add package CodeFirstWebFramework --version 1.3.24
<PackageReference Include="CodeFirstWebFramework" Version="1.3.24" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodeFirstWebFramework --version 1.3.24
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CodeFirstWebFramework Web App development tool

Now available as a NuGet package, downloadable directly from Visual Studio.

This DLL enables you to build a highly functional C# web app with minimal coding. Your Main method has only to call

Config.Load(args);
new WebServer().Start();

This will load (or create) the config file, analyse the code for classes which should be persisted to the database, ensure the database schema is up to date with the code, and start listening for web requests on the default port (8080).

The database is a local SQLite database by default, but can be set (in the config file) to any accessable MySql or Sql Server database. The default port and a number of other settings can also be overridden in the config file.

The web server will serve any html or other files placed in a subfolder with the same name as the main namespace of your project.

However, this is only the beginning. Instead of serving html files, the server can construct the html by merging Mustache .tmpl files with the default.tmpl file. This allows you to make the default.tmpl file a standard look and feel for the whole website, with individual page data being inserted in it as appropriate.

Even more useful, selected pages can be created or altered using C# code - each C# class which is a subclass of AppModule acts as a virtual directory, and each public method in that class acts as a virtual file in that directory. So, for example, a web request for /home/listing.html will create an object of the AppModule subclass Home, and call the Listing method. This method could retrieve a list of records from the database, and the home/listing.tmpl file could display them as a searchable table.

Because the templates are Mustache, you can insert information from variables in the C# program directly into the output html, including processing lists and arrays.

There is an extensive library of javascript (in default.js) which works with the C# code to provide support for forms, data tables, array list/edit forms and header-detail forms, along with callbacks to the C# code using ajax and json.

There is built-in support for backing up and restoring the database (to json format).

There is built in (but extensible) optional support for creating users with logins and passwords, and giving each user a permission level for the whole system, or even individual modules or methods.

There is also built-in support for GitHub style Markdown (like this file), both in general use, and for writing context-sensitive help with a table of contents.

The DLL can actually run multiple web servers on the same port (distinguished by the server part of the url), or different ports, each of which can use the same or different C# code (distinguished by C# Namespaces) and use different databases. You can also customise the look and feel of each server, as the template code looks for templates in a folder named for the server, then a folder named for the app namespace, then in the CodeFirstWebFramework folder.

More documentation is in contentFiles/Documentation.md

Api documentation is in contentFiles/Api.md

CodeFirstWebFramework Web App development tool

Now available as a NuGet package, downloadable directly from Visual Studio.

This DLL enables you to build a highly functional C# web app with minimal coding. Your Main method has only to call

Config.Load(args);
new WebServer().Start();

This will load (or create) the config file, analyse the code for classes which should be persisted to the database, ensure the database schema is up to date with the code, and start listening for web requests on the default port (8080).

The database is a local SQLite database by default, but can be set (in the config file) to any accessable MySql or Sql Server database. The default port and a number of other settings can also be overridden in the config file.

The web server will serve any html or other files placed in a subfolder with the same name as the main namespace of your project.

However, this is only the beginning. Instead of serving html files, the server can construct the html by merging Mustache .tmpl files with the default.tmpl file. This allows you to make the default.tmpl file a standard look and feel for the whole website, with individual page data being inserted in it as appropriate.

Even more useful, selected pages can be created or altered using C# code - each C# class which is a subclass of AppModule acts as a virtual directory, and each public method in that class acts as a virtual file in that directory. So, for example, a web request for /home/listing.html will create an object of the AppModule subclass Home, and call the Listing method. This method could retrieve a list of records from the database, and the home/listing.tmpl file could display them as a searchable table.

Because the templates are Mustache, you can insert information from variables in the C# program directly into the output html, including processing lists and arrays.

There is an extensive library of javascript (in default.js) which works with the C# code to provide support for forms, data tables, array list/edit forms and header-detail forms, along with callbacks to the C# code using ajax and json.

There is built-in support for backing up and restoring the database (to json format).

There is built in (but extensible) optional support for creating users with logins and passwords, and giving each user a permission level for the whole system, or even individual modules or methods.

There is also built-in support for GitHub style Markdown (like this file), both in general use, and for writing context-sensitive help with a table of contents.

The DLL can actually run multiple web servers on the same port (distinguished by the server part of the url), or different ports, each of which can use the same or different C# code (distinguished by C# Namespaces) and use different databases. You can also customise the look and feel of each server, as the template code looks for templates in a folder named for the server, then a folder named for the app namespace, then in the CodeFirstWebFramework folder.

More documentation is in contentFiles/Documentation.md

Api documentation is in contentFiles/Api.md

Release Notes

Ensure index list for a table is in the order the fields are declared, rather than alphabetical

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.3.24 57 9/21/2020
1.3.23 72 9/14/2020
1.3.22 24 9/14/2020
1.3.21 121 7/17/2020
1.3.19 50 7/17/2020
1.3.18 45 7/16/2020
1.3.17 58 7/6/2020
1.3.16 121 6/27/2020
1.3.11 103 6/17/2020
1.3.10 52 6/11/2020
1.3.9 148 5/22/2020
1.3.8 79 5/21/2020
1.3.4 71 5/15/2020
1.3.2 63 5/14/2020
1.2.29 167 3/21/2020
1.2.28 173 3/20/2020
1.2.25 114 3/3/2020
1.2.24 167 2/17/2020
1.2.22 203 12/26/2019
1.2.21 165 12/3/2019
1.2.20 116 11/22/2019
1.2.18 101 11/22/2019
1.2.16 98 11/14/2019
1.2.15 100 11/14/2019
1.2.14 107 11/11/2019
1.2.13 110 11/5/2019
1.2.12 162 9/23/2019
1.2.11 126 9/19/2019
1.2.10 129 9/2/2019
1.2.9 162 8/29/2019
1.2.8 131 8/28/2019
1.2.7 126 8/26/2019
1.2.6 155 8/23/2019
1.2.5 159 8/22/2019
1.2.2 220 7/26/2019
1.2.1 224 7/16/2019
1.2.0 221 7/11/2019
1.1.7 381 9/10/2018
1.1.6 405 7/4/2018
1.1.4 480 3/8/2018
1.1.3 459 3/1/2018
1.1.0 474 2/8/2018
1.0.17 527 12/12/2017
1.0.16 470 11/13/2017
1.0.14 445 9/1/2017
1.0.13 470 8/22/2017
1.0.12 443 8/14/2017
1.0.11 445 8/8/2017
1.0.10 456 8/3/2017
1.0.8 469 7/31/2017
1.0.7 447 7/25/2017
1.0.6 440 7/18/2017
1.0.2 453 7/18/2017
1.0.1 474 6/22/2017
1.0.0 461 6/20/2017