Skip to content
0:00 / 0:00

#blazor#webassembly#.net

Blazor WebAssembly With Single Web API | Programming with Palermo, ep.004

Clear Measure

1.7K subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Jeffrey Palermo, Chief Architect at Clear Measure
  • Linked in the descriptionjeffreypalermo/blazor-wasm-single-web-api
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

1.2K views4 years ago1 recommendation

Web developmentSoftware designVue, Svelte, Angular and othersHTTP, REST and GraphQLSoftware architecture

Jeffrey Palermo demonstrates a JSON serialization pattern to route client requests through a single API endpoint in Blazor WebAssembly applications.

With Blazor's implementation of WASM, the front end and the backend of a Blazor C# project is separated. This means that for the WASM project to run on the client side it needs to interact with a server to send and receive data. This is possible using API's however it's far too easy to create many api controllers for every reason to call to the server. With this Json Serialization pattern you will create a single API to send/receive data from the front end to the back end. This patterns prevents the creation of hundreds of API endpoints for Blazor WebAssembly applications as they grow. This demo will be going over what code is needed to be added to both the frontend and the backend. And how to add additional queries to your application. Here is the CODE SAMPLE: github.com/jeffreypalermo/blazor-wasm-single-web-api Thank you for watching Programming with Palermo. Our processes, tools, and resources are empowering countless development teams all around the world. Subscribe for more great content! • Architect Tips — New video podcast: architecttips.clearmeasure.com/ • Azure DevOps: azure.microsoft.com • Azure DevOps Podcast: youtube.com/playlist?list=PLccbmtqZglzq_Sn2SNGBjefm_rPsTImng • Clear Measure (Sponsor): clear-measure.com/ • .NET DevOps for Azure: A Developer’s Guide to DevOps Architecture the Right Way, by Jeffrey Palermo — Available on Amazon: amazon.com/dp/1484253426/ref=sr_1_4?crid=2274W16KUQ09A • Jeffrey Palermo’s Twitter — Follow to stay informed about future events: twitter.com/jeffreypalermo #blazor #webassembly #webapi

Why it's here

1 person recommends this

What people say. Recommended as an alternative pattern to avoid creating numerous API endpoints in Blazor WebAssembly.

u/commentsOnPizzain r/dotnet • Recommends

On “Is Blazor worth learning?”

…ly helps here. Third, with Server you can just access stuff like your database directly. With WASM, you need to create an API endpoint on your server and then call that endpoint from the WASM client. This means more code to write, though they are supposedly working on making it so you won't have to do as much and you can use a technique like this: link to this video Basically, instead of writing lots of API endpoints, you can create one endpoint that will take messages and respond to them appropriately. And you can combine these techniques too. I set up my stuff to use Blazor SSR combined with WASM. I get an instant first-load and the WASM is downloaded in the background. You can also use full-auto wh…