Flat Forms: How to start - ProCodersPtyLtd/MasterDetailsDataEntry GitHub Wiki
-
Install Platz.SqlForms NuGet package to your Blazor Server App project
Important: You should see folders [Platz.Example.Link] and [Platz.Config.Link] in your project with code samples, configs and scripts
-
Modify your project startup.cs file add
using Platz.SqlForms;
and add code toConfigureServices
method:
services.AddPlatzSqlForms();
- Modify _Imports.razor and add references:
@using Platz.SqlForms
-
Add the following references to jquery and bootstrap just before your styles to _Host.cshtml:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
-
Blazor Server App project should contain Entity Framework DbContext or should reference to project containing the DbContext
-
Create a Dynamic Form definition - a class that is inherited from
DynamicEditFormBase<TContext>
, where TContext is your DbContext type, for example:public class CourseEditForm : DynamicEditFormBase<SchoolContext>
-
Create Blazor page and place
FormDynamicEditComponent
that references to your form definition, for example:<FormDynamicEditComponent TForm="CourseEditForm" Id="@CourseId" />
Self-contained Demo project can be found here link