Sharing Code and Resources
Setting Up The API Only Blazor WebAssembly requires access to the Web API because it lacks direct access to the database. For Blazor Server, it's likely that the most prevalent architecture involves utilizing a Web API as well. We need to transfer the files we can share into a different library. To accomplish this, please follow these steps: Right-click on the MyBlog solution and select Add | New Project. Search for Class Library (.NET Core) and then click Next. Name the project MyBlog.Data.Shared and keep the location as is and then click Create. Select target framework .NET 5.0 (Current) and then click Create. Right-click on the Dependencies node under the MyBlogWebAssembly.Client project. Click Add project reference, check the MyBlog.Data.Shared and MyBlog.Shared checkboxes, and then click OK. Move the following files from the MyBlog.Data project to MyBlog.Data. Shared: Extension - folder Interfaces - folder Models/BlogPost.cs Models/Category.cs Models/Tag.cs MyBl...