diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs index f1d9d1e..b8f1093 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs @@ -16,10 +16,11 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); +string baseAddress = "http://localhost:1050"; builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddScoped(sp => new FormClient("http://localhost:1050", sp.GetService())); -builder.Services.AddScoped(sp => new NoParentFormItemClient("http://localhost:1050", sp.GetService())); +builder.Services.AddScoped(sp => new FormClient(baseAddress, sp.GetService())); +builder.Services.AddScoped(sp => new NoParentFormItemClient(baseAddress, sp.GetService())); builder.Services.AddTransient(); builder.Services.AddTransient(); diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj index 4ebf3ae..18cec40 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj @@ -4,7 +4,7 @@ net6.0;net7.0 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 TemplateGenerator UI compoents. EasyMicroservices@gmail.com component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor index b174782..44a5666 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor @@ -24,7 +24,7 @@ - + diff --git a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj index 44ecdec..38514fa 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj +++ b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj @@ -4,7 +4,7 @@ net6.0;net7.0 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 TemplateGenerator view model. EasyMicroservices@gmail.com component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator diff --git a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs index 31b6510..1fd53e6 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs @@ -2,6 +2,7 @@ using EasyMicroservices.UI.Cores; using EasyMicroservices.UI.Cores.Commands; using System.Collections.ObjectModel; +using System.Text; using System.Windows.Input; using TemplateGenerators.GeneratedServices; @@ -102,6 +103,13 @@ T GetCurrentProperty(Func func) return UpdateFormContract == null ? default : func(UpdateFormContract); } + public string GetTitle(FormItemContract formItemContract) + { + if (formItemContract.Title.IsNullOrEmpty()) + return formItemContract.PrimaryFormItem?.Title ?? GetLanguage("NoName!"); + return formItemContract.Title; + } + public async Task LoadConfig() {