I need to clear the code from unnecessary notes and implement a demo db before publishing. Maybe I will publish without db implementation. But I am tired a little bit of the project and I am lazy to do it right now. Your question is very wide. I changed target framework (for client-side in future), overrode the router, implemented native DI (memory leak of Autofac on preview stages), rewrote all necessary views to razor pages, rewrote all necessary controllers to the same razor pages, moved out all scripts to a js file, wrote some of extensions and utilities. I tried hard not to modify the native nopcommerce code like core, data, services and framework, only wrapping or overriding if it had needed.
HI, I was wondering if there is a chance we can just use Blazor in addition to the standard pages and services in NOP 4.3 since it is using .NET Core 3.1.
If not, what steps would we have to do to add it? I seem to have gotten as far as being able to load a .razor component, but it doesn't communicate with the server from the page. It is acting as a static form. I seem to be missing something.
Hi, In common, yes, we can. Unfortunately your question is quite wide one to give you a more exact answer. I think you should have learnt asp.net core, Nop and Blazor a little bit deeply. Blazor is being based on asp.net core so you can combine and mix the 'standard' asp.net core mvc pages and the blazor pages in one app. In respect to your second piece of the topic, I don't know how I can help you because I haven't seen your code.
I have been quite successful in other smaller projects, but I haven't gotten it to work completely in my NOP 4.3 solution. Everything I have will load and run though, but it doesn't communicate with server once it is rendered.
I need help identifying where to add the parts correctly to make Blazor work. I am not getting any errors, and I am sure others would benefit from knowing this as well. I have gone through the NOP documentation and I didn't find it there.
My question is: Is there documentation on adding Blazor to NOP 4.3 and if so, would you please share that? If there is no documentation, would anyone be willing to share an updated version of the tutorials I have linked to on how to add Blazor to a NOP Commerce 4.3 solution?
I have finally found a solution after struggling for a whole day. The solution is to follow the instructions from the blog posts above but instead of registering Blazor the normal way, add this class in Nop.Web.Framework.Infrastructure
using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Nop.Core.Infrastructure;
namespace Nop.Web.Framework.Infrastructure { public class BlazorStartup : INopStartup { public int Order => 999;//It has to be registered before NopMVCStartup
public void Configure(IApplicationBuilder application) { application.UseRouting();