Platz.SqlForms Flat Forms programming reference - ProCodersPtyLtd/MasterDetailsDataEntry GitHub Wiki
Platz.SqlForms framework is supposed to be installed using the NuGet package that can be found in Visual Studio Package Manager, the official link is: https://www.nuget.org/packages/Platz.SqlForms
To use Platz.SqlForms framework you will need to do these steps:
- Create a Dynamic Form definition - a class that is inherited from
DynamicEditFormBase<TContext>
- Use razor component
FormDynamicEditComponent
on a Blazor page to render the created Dynamic Form definition - For List Forms create a from definition inherited from
DataServiceBase<TContext>
and render it byFormDataServiceListComponent
using DemoSqlForms.Database.Model;
using Platz.SqlForms;
namespace DemoSqlForms.App.Forms
{
public class CourseEditForm : DynamicEditFormBase<SchoolContext>
{
protected override void Define(DynamicFormBuilder builder)
{
builder.Entity<Course>(e =>
{
e.Property(p => p.CourseID).IsPrimaryKey().IsUnique();
e.Property(p => p.Title).IsRequired();
e.Property(p => p.Credits).IsRequired();
e.DialogButton(ButtonActionTypes.Cancel).DialogButton(ButtonActionTypes.Submit);
e.DialogButtonNavigation("CourseList", ButtonActionTypes.Cancel, ButtonActionTypes.Delete, ButtonActionTypes.Submit);
});
}
}
}
@page "/CourseEdit/{CourseId:int}"
@page "/CourseEdit"
<h1>Course Edit</h1>
<FormDynamicEditComponent TForm="CourseEditForm" Id="@CourseId" />
@code {
[Parameter]
public int CourseId { get; set; }
}