Sample applications
You can find sample applications on the project's GitHub page which can help demonstrate how this library can be used. Those are:
Books and authors
- Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple
- Download it as a .zip: master.zip
This sample application demonstrates how to consume the DynamicVML RCL from a .NET Core App 3.1 application running ASP.NET MVC for presentation and Entity Framework Core for persistence. It consists of a simple CRUD example where you can list, add, edit, and delete book authors and include details about the books they have written. The books are added and removed from the CRUD pages using DynamicVML.
Books and authors (customized layouts)
- Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-options
- Download it as a .zip: master.zip
This version of the sample application shows how to customize the layouts of the lists and how to create view models for display options associated with each item in a list, e.g., titles and subtitles for Bootstrap Cards.
Books and authors (parameterized templates)
- Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters
- Download it as a .zip: master.zip
This version of the sample application shows how to create parameterized templates that can have their behaviour customized depending on additional view data specified inside the view (.cshtml). This sample also shows how to make the user request new items to be added to the list via POST.
Razor Class Libraries (RCL)
Those examples, together with the library iself, can also serve as an example on how to create a reusable Razor Class Library (RCL) that contain static resources and how to consume it from your applications in .NET Core 3.1. There is currently some confusion on how to achieve this due the significant amount of outdated tutorials and Stackoverflow answers out there.
- Here is the .csproj configuration for the library.
- Here are the Program.cs and Startup.cs for the consumer applications.
Tip
Never use the standalone nuget.exe to pack Razor libraries. Always use dotnet nuget pack instead. They are completely different beasts.