Skip to main content

Posts

Showing posts from June, 2021

.Net5 Blazor WebAssembly Application Invoke GraphQL Endpoints Using Strawberry Shake Library

In this article, we will implement a Blazor WebAssembly Application that consumes GraphQL endpoints using the Strawberry Shake library. Strawberry Shake: Strawberry Shake is a GraphQL client library that can be used by the .Net Standard Library. So all .NetCore applications (from .Net5) like APIs, MVC, Blazor Server, Blazor WebAssembly, etc. Strawberry Shake will generate all boilerplate code for the GraphQL Server schema, which lays an easy path for consuming the data from our Blazor WebAssembly application. Strawberry Shake CLI Tool Configuration: Strawberry Shake CLI needs to be configured because CLI will help us to generate the GraphQL client. Create a dotnet tool-manifest dotnet new tool-manifest Now install the Strawberry Shake CLI Tool dotnet tool install StrawberryShake.Tools --local Create A .Net5 Blazor WebAssembly Project: Let's start our journey by creating a .Net5 Blazor WebAssembly application sample project. Visual Studio users can easily create .Net5 Bl

.NET5 Blazor Server CRUD Operation Using Entity Framework Core

In this article, we are going to implement CRUD operations in .Net5 Blazor Server application. Blazor Server: Blazor Server is a single-page application. At the server, a pre-rendered HTML output of the page will be delivered to the user browsers. Any UI update, event handling, javascript calls will carry over by a SignalR connection to the server. So application updates or depends on the continuous connection of the SignalR. So Blazor Server is a single-page application that will be made of c#. Since the blazor server only outputs the pre-rendered HTML to the client, so there is no c# code downloading into user browsers like in Blazor Webassembly(c# code downloaded and runs in browser for blazor webassembly application). Role Of SignalR Connection: A Blazor Server application works over a SignalR connection. A Blazor Server application creates a UI State memory at the server which will be interacted by the SignalR connections. If a SignalR connection got interrupted, then the clie

.NET5 Web API CRUD Operation Using Entity Framework Core

In this article, we are going to understand about the .Net5 Web API CRUD operations using the entity framework core. Web API: Web API is a framework for building HTTP services that can be accessed from any client including browser and mobile devices. In simple terminology API(Application Programming Interface) means an interface module that contains programming functions that can be requested via HTTP calls to serve the data to respective clients. Some of the key characteristics of API: Supports HTTP verbs like 'GET', 'POST', 'PUT', 'Delete',etc. Supports default responses like 'XML' and 'JSON'. Also can define custom responses. Supports self-hosting or individual hosting, so that all different kind of apps or clients can consume it. Authentication and Authorization are easy to implement. The ideal platform to build REST full services. Create A .Net5 Web API Application: Let's begin our journey by creating a sample .Net5 Web API

.NET5 MVC CRUD Operations Using Entity Framework Core

In this article, we will learn about .Net5 MVC CRUD operation using Entity Framework Core. MVC: The Model-View-Controller(MVC) is an architectural pattern. MVC divides UI applications into 3 different layers. Each layer will have its own responsibility. An MVC application on encountering the user request will be sent to the controller. The controller will query the required data from the database and then furnished our data into 'Model' and then select appropriate 'View'. The 'View' will render the data or logic inside of the 'Model'. The 'Model' is the bridge between 'Controller' and 'View' for transferring the data. So in  MVC, the 'Controller' depends on both 'Model' and 'View', the 'View' depends on 'Model'. Create A .Net5 MVC Application: Begin our journey by creating a .Net5 MVC application. Visual Studio users can easily create a .Net5 MVC templated application. On Creating applic