From 676b0bd176a33212507153848e24af5e8ac3be23 Mon Sep 17 00:00:00 2001 From: "hualin.zhu" Date: Thu, 14 Nov 2024 20:09:13 +0800 Subject: [PATCH] add ActiveUserSession --- src/Templatemap.cs | 4 ++-- src/Templates/Pages/.edit.razor.txt | 3 +++ src/Templates/Pages/.razor.txt | 2 +- src/Templates/Pages/Components/.formdialog.razor.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Templatemap.cs b/src/Templatemap.cs index 6ef22e8..75a93d1 100644 --- a/src/Templatemap.cs +++ b/src/Templatemap.cs @@ -424,7 +424,7 @@ private static string createMudTdHeaderDefinition(IntellisenseObject classObject output.Append($"
\r\n"); if (classObject.Properties.Where(x => x.Type.IsKnownType == true && x.Name == defaultfieldName.First()).Any()) { - output.Append($" @context.Item.Name\r\n"); + output.Append($" @context.Item.Name\r\n"); } if (classObject.Properties.Where(x => x.Type.IsKnownType == true && x.Name == defaultfieldName.Last()).Any()) { @@ -526,7 +526,7 @@ private static string createMudFormFieldDefinition(IntellisenseObject classObjec case "string" when property.Name.Equals("Description", StringComparison.OrdinalIgnoreCase): output.Append($" \r\n"); output.Append(" "); - output.Append($" x.{property.Name})]\" Lines=\"3\" For=\"@(() => model.{property.Name})\" @bind-Value=\"model.{property.Name}\">\r\n"); + output.Append($" x.{property.Name})]\" For=\"@(() => model.{property.Name})\" @bind-Value=\"model.{property.Name}\">\r\n"); output.Append(" "); output.Append($" \r\n"); break; diff --git a/src/Templates/Pages/.edit.razor.txt b/src/Templates/Pages/.edit.razor.txt index 490c829..e05eb3e 100644 --- a/src/Templates/Pages/.edit.razor.txt +++ b/src/Templates/Pages/.edit.razor.txt @@ -2,6 +2,8 @@ @using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Commands.Update @using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Mappers @using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Queries.GetById +@using CleanArchitecture.Blazor.Server.UI.Components.Fusion + @inherits MudComponentBase @inject IValidationService Validator @inject IStringLocalizer<{nameofPlural}> L @@ -18,6 +20,7 @@ + {mudFormFieldDefinition} diff --git a/src/Templates/Pages/.razor.txt b/src/Templates/Pages/.razor.txt index f9d923f..dae968b 100644 --- a/src/Templates/Pages/.razor.txt +++ b/src/Templates/Pages/.razor.txt @@ -40,7 +40,7 @@ - @Title + @Title diff --git a/src/Templates/Pages/Components/.formdialog.razor.txt b/src/Templates/Pages/Components/.formdialog.razor.txt index 70ddcc4..8791030 100644 --- a/src/Templates/Pages/Components/.formdialog.razor.txt +++ b/src/Templates/Pages/Components/.formdialog.razor.txt @@ -25,7 +25,7 @@ private bool _saving = false; private bool _savingnew = false; [CascadingParameter] - MudDialogInstance MudDialog { get; set; } = default!; + IMudDialogInstance MudDialog { get; set; } = default!; AddEdit{itemname}CommandValidator _modelValidator = new (); [EditorRequired] [Parameter] public AddEdit{itemname}Command model { get; set; } = null!; async Task Submit()