Blog
Blog posts on .NET, Azure, and more.
Create Azure Functions with GraphQL Support
December 05, 2021 by Anuraj
DotNetCore GraphQL Serverless Azure Azure Functions
This post is about creating .NET Core Azure Functions with GraphQL Support. For supporting GraphQL we are using the HotChocolate package. First we need create an Azure Function using the func init GraphQL-Azure-Function --dotnet command. Or if you’re using VSCode create a function with dotnet runtime and HTTP Trigger. Next we need to add the HotChocolate.AzureFunctions package - which will help you to configure the Azure Function with GraphQL attribute. Here is the code for the Azure Function.
GraphQL Subscriptions in ASP.NET Core
December 01, 2021 by Anuraj
AspNetCore GraphQL DotNet6
This post is about implementing Subscriptions in GraphQL. Subscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with WebSockets. The subscription type is almost implemented like a query. Most cases subscriptions are raised through mutations, but subscriptions could also be raised through other backend systems.
GraphQL Mutations in ASP.NET Core
November 27, 2021 by Anuraj
AspNetCore GraphQL DotNet6 EFCore
This post is about GraphQL in ASP.NET Core with EF Core. In this post we will explore how to implement mutations using ASP.NET Core. Mutations help you to update the data in the database. Here is the Mutation class. In this class, we are adding the link object to database using Entity Framework Core.
Azure Functions - Could not load file or assembly System.Text.Encoding.CodePages
November 27, 2021 by Anuraj
Azure Functions Serverless
This post is about how to fix the exception Could not load file or assembly System.Text.Encoding.CodePages when you’re using any HTML parser in Azure Functions. Recently while working on Azure Static Web App, I faced an issue like this. I created an Azure Function in Dotnet, which helps to parse HTML from URLs. I was using a nuget package - OpenGraph-Net. And after I deployed the function, it is started throwing this error - Exception while executing function: <Function Name> Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. It is working properly on my machine.
Working with model validation in Minimal APIs
November 17, 2021 by Anuraj
AspNetCore
This post is about implementing model validation in ASP.NET Core Minimal APIs. Minimal APIs do not come with any built-in support for validation. In this post we will explore how to build one and we explore will use some other libraries which can be used to implement validations.
Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub