CodeFirstWebFramework 1.3.97

.NET Standard 2.0 .NET Framework 4.7.2
dotnet add package CodeFirstWebFramework --version 1.3.97
NuGet\Install-Package CodeFirstWebFramework -Version 1.3.97
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeFirstWebFramework" Version="1.3.97" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodeFirstWebFramework --version 1.3.97
#r "nuget: CodeFirstWebFramework, 1.3.97"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CodeFirstWebFramework as a Cake Addin
#addin nuget:?package=CodeFirstWebFramework&version=1.3.97

// Install CodeFirstWebFramework as a Cake Tool
#tool nuget:?package=CodeFirstWebFramework&version=1.3.97

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

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.97 67 3/22/2023
1.3.96 79 3/16/2023
1.3.95 171 1/10/2023
1.3.94 148 1/5/2023
1.3.93 149 1/4/2023
1.3.89 218 11/17/2022
1.3.85 218 11/15/2022
1.3.84 226 11/12/2022
1.3.83 224 11/10/2022
1.3.82 237 11/3/2022
1.3.81 329 10/14/2022
1.3.80 308 8/23/2022
1.3.79 314 8/4/2022
1.3.78 329 7/20/2022
1.3.77 353 6/9/2022
1.3.76 322 6/8/2022
1.3.73 363 5/4/2022
1.3.72 331 4/27/2022
1.3.71 318 4/27/2022
1.3.70 360 4/7/2022
1.3.69 335 3/31/2022
1.3.68 329 3/29/2022
1.3.67 325 3/25/2022
1.3.66 321 3/23/2022
1.3.65 338 3/15/2022
1.3.61 331 3/11/2022
1.3.59 322 12/9/2021
1.3.57 306 9/28/2021
1.3.55 293 9/19/2021
1.3.54 379 7/12/2021
1.3.53 303 6/21/2021
1.3.52 265 6/21/2021
1.3.51 284 6/18/2021
1.3.50 318 5/11/2021
1.3.49 324 3/17/2021
1.3.48 304 3/8/2021
1.3.47 314 3/5/2021
1.3.46 364 3/5/2021
1.3.44 433 2/15/2021
1.3.42 415 2/15/2021
1.3.41 411 2/5/2021
1.3.37 573 11/27/2020
1.3.36 461 11/25/2020
1.3.35 496 11/22/2020
1.3.34 505 11/20/2020
1.3.33 530 11/18/2020
1.3.31 515 11/6/2020
1.3.30 550 10/30/2020
1.3.27 484 10/16/2020
1.3.26 554 10/16/2020
1.3.25 561 10/14/2020
1.3.24 555 9/21/2020
1.3.23 568 9/14/2020
1.3.22 497 9/14/2020
1.3.21 594 7/17/2020
1.3.19 536 7/17/2020
1.3.18 511 7/16/2020
1.3.17 545 7/6/2020
1.3.16 583 6/27/2020
1.3.11 594 6/17/2020
1.3.10 563 6/11/2020
1.3.9 598 5/22/2020
1.3.8 523 5/21/2020
1.3.4 528 5/15/2020
1.3.2 535 5/14/2020
1.2.29 636 3/21/2020
1.2.28 676 3/20/2020
1.2.25 586 3/3/2020
1.2.24 627 2/17/2020
1.2.22 701 12/26/2019
1.2.21 646 12/3/2019
1.2.20 616 11/22/2019
1.2.18 604 11/22/2019
1.2.16 577 11/14/2019
1.2.15 581 11/14/2019
1.2.14 600 11/11/2019
1.2.13 608 11/5/2019
1.2.12 606 9/23/2019
1.2.11 632 9/19/2019
1.2.10 611 9/2/2019
1.2.9 642 8/29/2019
1.2.8 571 8/28/2019
1.2.7 581 8/26/2019
1.2.6 641 8/23/2019
1.2.5 621 8/22/2019
1.2.2 683 7/26/2019
1.2.1 715 7/16/2019
1.2.0 745 7/11/2019
1.1.7 907 9/10/2018
1.1.6 942 7/4/2018
1.1.4 1,074 3/8/2018
1.1.3 1,029 3/1/2018
1.1.0 1,068 2/8/2018
1.0.17 1,117 12/12/2017
1.0.16 1,026 11/13/2017
1.0.14 999 9/1/2017
1.0.13 1,038 8/22/2017
1.0.12 1,004 8/14/2017
1.0.11 1,007 8/8/2017
1.0.10 1,011 8/3/2017
1.0.8 1,020 7/31/2017
1.0.7 1,001 7/25/2017
1.0.6 983 7/18/2017
1.0.2 1,011 7/18/2017
1.0.1 1,016 6/22/2017
1.0.0 1,030 6/20/2017

Fix bug which recursed infinitely if a view contained its own table name