diff --git a/src/BackendApi/BackendApi.csproj b/src/BackendApi/BackendApi.csproj index 4f8ef53..4e9a43f 100644 --- a/src/BackendApi/BackendApi.csproj +++ b/src/BackendApi/BackendApi.csproj @@ -1,21 +1,21 @@  - net7.0 + net8.0 v3 - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/BxBlazor/BxBlazor.csproj b/src/BxBlazor/BxBlazor.csproj index 51edd1b..1d0a9ec 100644 --- a/src/BxBlazor/BxBlazor.csproj +++ b/src/BxBlazor/BxBlazor.csproj @@ -11,8 +11,8 @@ ChkPartner - - - + + + diff --git a/src/BxBlazor/Components/Grid/BxCol.razor b/src/BxBlazor/Components/Grid/BxCol.razor index de867cf..b86771c 100644 --- a/src/BxBlazor/Components/Grid/BxCol.razor +++ b/src/BxBlazor/Components/Grid/BxCol.razor @@ -5,7 +5,6 @@
@ChildContent
-
@code { [Parameter] public string lg { get; set; } diff --git a/src/BxBlazor8/BxBlazor8.csproj b/src/BxBlazor8/BxBlazor8.csproj index fed7172..af28530 100644 --- a/src/BxBlazor8/BxBlazor8.csproj +++ b/src/BxBlazor8/BxBlazor8.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/SampleProject/Client/App.razor b/src/SampleProject/Client/App.razor index 21f0f1e..8664531 100644 --- a/src/SampleProject/Client/App.razor +++ b/src/SampleProject/Client/App.razor @@ -1,11 +1,4 @@ - - -@using BlazorState.Services -@using BlazorState.Pipeline.ReduxDevTools -@using BlazorState.Features.JavaScriptInterop -@using BlazorState.Features.Routing - - + @@ -17,19 +10,4 @@ @code { - [Inject] private JsonRequestHandler JsonRequestHandler { get; set; } -#if ReduxDevToolsEnabled - [Inject] private ReduxDevToolsInterop ReduxDevToolsInterop { get; set; } -#endif - // Injected so it is created by the container. Even though the IDE says it is not used, it is. - [Inject] private RouteManager RouteManager { get; set; } - - - protected override async Task OnAfterRenderAsync(bool firstRender) - { -#if ReduxDevToolsEnabled - await ReduxDevToolsInterop.InitAsync(); -#endif - await JsonRequestHandler.InitAsync(); - } } \ No newline at end of file diff --git a/src/SampleProject/Client/Pages/DataTable.razor b/src/SampleProject/Client/Pages/DataTable.razor index a03f42c..6255691 100644 --- a/src/SampleProject/Client/Pages/DataTable.razor +++ b/src/SampleProject/Client/Pages/DataTable.razor @@ -1,5 +1,6 @@ @page "/components/bx-datatable" @using blazorwasm.Shared + @inject HttpClient Http @inject IJSRuntime js
@@ -26,7 +27,7 @@ protected override async Task OnInitializedAsync() { - forecasts = await Http.GetJsonAsync("WeatherForecast") + forecasts = await Http.GetFromJsonAsync("WeatherForecast") .ContinueWith(t => t.IsFaulted ? get_forcasts() : null); } diff --git a/src/SampleProject/Client/Pages/FetchData.razor b/src/SampleProject/Client/Pages/FetchData.razor index 07e96a5..5a829f6 100644 --- a/src/SampleProject/Client/Pages/FetchData.razor +++ b/src/SampleProject/Client/Pages/FetchData.razor @@ -31,7 +31,7 @@ protected override async Task OnInitializedAsync() { - forecasts = await Http.GetJsonAsync("WeatherForecast").ContinueWith(t => t.IsFaulted ? get_forcasts() : null); + forecasts = await Http.GetFromJsonAsync("WeatherForecast").ContinueWith(t => t.IsFaulted ? get_forcasts() : null); } private readonly string[] Summaries = new[] { diff --git a/src/SampleProject/Client/Pages/UIShell.razor b/src/SampleProject/Client/Pages/UIShell.razor index e7efd28..7dd69c6 100644 --- a/src/SampleProject/Client/Pages/UIShell.razor +++ b/src/SampleProject/Client/Pages/UIShell.razor @@ -4,7 +4,7 @@ - +

Heading

@for (var i = 0; i <= 10; i++) { diff --git a/src/SampleProject/Client/Program.cs b/src/SampleProject/Client/Program.cs index c9d5952..7178f0b 100644 --- a/src/SampleProject/Client/Program.cs +++ b/src/SampleProject/Client/Program.cs @@ -1,9 +1,9 @@ using System.Threading.Tasks; using BxBlazor.Services; using Microsoft.Extensions.DependencyInjection; -using MediatR; -using BlazorState; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using System.Net.Http; +using System; namespace blazorwasm.Client { public class Program @@ -11,12 +11,11 @@ public class Program public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); - - builder.Services.AddMediatR(typeof(App).Assembly); - builder.Services.AddBlazorState(o => + builder.Services.AddScoped(http => new HttpClient { - o.UseReduxDevToolsBehavior = true; + BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + builder.RootComponents.Add("app"); await builder.Build().RunAsync(); diff --git a/src/SampleProject/Client/Shared/MainLayout.razor b/src/SampleProject/Client/Shared/MainLayout.razor index 0ca8f1a..3202587 100644 --- a/src/SampleProject/Client/Shared/MainLayout.razor +++ b/src/SampleProject/Client/Shared/MainLayout.razor @@ -2,9 +2,6 @@ @using System.Linq @using System.IO -@using BlazorState -@using BlazorState.Services -@using MediatR @inject IJSRuntime jsRuntime @inject HttpClient http diff --git a/src/SampleProject/Client/Shared/ShellLayout.razor b/src/SampleProject/Client/Shared/ShellLayout.razor index 5f061d6..4193326 100644 --- a/src/SampleProject/Client/Shared/ShellLayout.razor +++ b/src/SampleProject/Client/Shared/ShellLayout.razor @@ -1,8 +1,4 @@ -@inherits BlazorStateComponent -@using BlazorState -@using MediatR - -@inject IJSRuntime jsRuntime +@inject IJSRuntime jsRuntime @inject HttpClient http - + @ChildContent @@ -44,16 +40,15 @@ // we create an announymous object that will hold the deserialized json to do so // we will use an extension method through which we will act on the result - (new - { - Sections = Sections, - SwitcherLinks = SwitcherLinks, - HeaderNavLinks = HeaderNavLinks, - HeaderActions = HeaderActions - }) // next step is to deserialize the json to the type of the announymous object - .pipeTo(anonymousObject => - Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(Globals.UIShellStructure, anonymousObject)) + + Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(Globals.UIShellStructure, new + { + Sections = Sections, + SwitcherLinks = SwitcherLinks, + HeaderNavLinks = HeaderNavLinks, + HeaderActions = HeaderActions + }) // the we pipe the result to extract the shell structure as IEnumerables .pipeTo(result => { @@ -76,20 +71,20 @@ await base.OnAfterRenderAsync(firstRender); } - protected new T GetState() - { - Type stateType = typeof(T); - Subscriptions.Add(stateType, this); + // protected new T GetState() + // { + // Type stateType = typeof(T); + // Subscriptions.Add(stateType, this); - return base.GetState(); - //return Store.GetState(); - } + // return base.GetState(); + // //return Store.GetState(); + // } - new IMediator Mediator { get => base.Mediator; set => base.Mediator = value; } - new IStore Store { get => base.Store; set => base.Store = value; } + // new IMediator Mediator { get => base.Mediator; set => base.Mediator = value; } + // new IStore Store { get => base.Store; set => base.Store = value; } - new void ReRender() - { - base.ReRender(); - } + // new void ReRender() + // { + // base.ReRender(); + // } } diff --git a/src/SampleProject/Client/_Imports.razor b/src/SampleProject/Client/_Imports.razor index 9b1ec7c..2fedebf 100644 --- a/src/SampleProject/Client/_Imports.razor +++ b/src/SampleProject/Client/_Imports.razor @@ -1,4 +1,5 @@ @using System.Net.Http +@using System.Net.Http.Json; @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web diff --git a/src/SampleProject/Client/blazorwasm.Client.csproj b/src/SampleProject/Client/blazorwasm.Client.csproj index 16d0a53..86d6760 100644 --- a/src/SampleProject/Client/blazorwasm.Client.csproj +++ b/src/SampleProject/Client/blazorwasm.Client.csproj @@ -8,11 +8,11 @@ - - - - + + + +