Posts

Showing posts from November, 2020

GraphQL Hello World in .NET

Image
GraphQL is the query language for the API. With an API endpoint, any data can be retrieved from the server. You can tell the API what data you want, the API will return those values. So it helps to avoid multiple requests and instead of getting all the data and selecting the one you want, you can tell the API what you want and it will send that data. This article explains how to create the first basic GraphQL in .NET. Let’s look at it with some sample code. First, you have to install the GraphQL package. You can install the latest version of GraphQL from NuGet. The following is a command to install the GraphQL package PM> Install-Package GraphQL Next, you need to install the JSON.NET serializer for GraphQL.NET. The below command installs NewtonsoftJson for the application. PM> Install-Package GraphQL.NewtonsoftJson The following is the .NET C # console application. First I added the necessary packages. Then the schema was initialized. The schema states what the requ

Debugging Blazor WebAssembly Application in Browser

Image
This article is going to explain how to debug the Blazor WebAssembly application on the Chrome browser's Dev tool. Let’s look at it step by step Step 1: I have developed a small calculate application in Blazer to demonstrate the debugging process. It calculates simple arithmetic. If users click the Calculate button it will display the results. The following is a screenshot of the calculated code snippet. Step 2: Press Shift+Alt+D (When focusing the application). This will open a new tab with the message “Unable to find debuggable browser tab” . But at the same time, the page gives instructions on how to get this. Step 3: Press Win + R . This will open a run window. Enter the command specified on the page in the open text box (chrome --remote-debugging-port=9222 --user-data-dir="C:\Users\golda\AppData\Local\Temp\blazor-chrome-debug" https://localhost:44366/calculate). And click ok. This will reopen the application in another Chrome bro

Progressive Web App (PWA) Manifest File in Blazor

Image
This article is going to explain what a manifest file is and how to use it in the PWA Blazor application. You can easily configure the manifest in your Blazor app. Let's see how to do it. What is a Manifest File? Manifest is a single JSON file that tells the browser what kind of application it is, What is the name of the application? Where is the application icon? What background color and etc. The manifest file name must be manifest.json While creating the Blazor application , it will automatically create the manifest.json file under wwwroot folder. The following is a default manifest.json code. { "name" : "SamplePWABlazorApp" , "short_name" : "SamplePWABlazorApp" , "start_url" : "./" , "display" : "standalone" , "background_color" : "#ffffff" , "theme_color" : "#03173d" , "icons" : [ { "src" : "icon-5