How Vanity Can Help You Feel Better

Vanity has always been at odds with society. How about we take the bright side of it this time? This way we might become who we are.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Data access strategy for Blazor Application

In this blog we will discuss the architecture that will help us to easily convert a Blazor Server Application into a Blazor WebAssembly Application.

Let’s first discuss the problem. As we already know that a Blazor Server Application runs on a server and a Signal R connection is established between the server and the client browser. To access the data, Blazor Server Application can directly talk to a database server using Entity Framework core or some other data access framework. As Entity Framework Core cannot run on a browser, converting the application to WebAssembly will require a lot of rework and code change.

The solution to this is to follow below architecture. As per this architecture we will have a Restful service between a Blazor Application and the Database. The Blazor Application will call the Restful service and the Restful service will call the database using Entity Framework Core. Since the Restful service will be running server side with a .Net core enabled server, we will have access to all server side resources and data including the capability to run Entity Framework code.

The benefit of this approach is that the code we will write to consume the Restful service can be used with both Blazor Server and Blazor WebAssembly hosting model. This helps to easily convert the application from a Blazor Server to a Blazor WebAssembly with minimal changes.

We will use this approach while developing our Employee Management Application in future blogs. Thank you for reading.

Add a comment

Related posts:

A Sea Turbulent as Me

Pat always told me he wanted us to be on the west coast because the waters were calm, not like the violent waves we used to see in Maine. I stood looking out at the water, almost in awe of the…

Store Arrays in Azure KeyVault using DevOps ARM Templates

How to store an array of values from your appsetting.json files in Azure KeyVault and do so using ARM Templates. Let’s say you have an appsettings.json file that has a Class with a Property that is…

Spin off

Seorang lelaki berjalan menuju kamar akira yg pintunya sedikit terbuka, lalu dia menggeser pintu itu sedikit lalu masuk dan membuat sang gadis terpekik kaget. Lelaki tinggi itu kembali menggeser…