Skip to main content

Posts

Showing posts with the label dotnet7

Entity Framework Core 7 JSON Columns | Mapping | Querying | Updating | Example

In this article, we are going to discuss about EF Core 7 feature that JSON data mapping, querying and updating operation. JSON Document Case Study: Here we can observe a 'Employee' table whose contact details are saved as document data. In general, we have to read it as string data in our dotnet application. But EF Core 7 supports that we can map the JSON document as a normal C# class and also we query them and also we can update the data inside of the document either fully or partially. Fetch JSON As Simple String: First, let's check the simple API endpoint which will fetch data directly which means our 'ContactDetails' column in the database is a simple string. Our table class is like 'Employee.cs'. Employee.cs: public class Employee { public int Id { get; set; } public string? FullName { get; set; } public string? ContactDetails { get; set; } } Our database context is like 'MyWorldDbContext.cs'. MyWorldDbContext.cs: using Dot7.JsonM

.NET 7 | Web API | Azure Blob Storage | File Management | Example

This article will explain the communication between Web API(.NET 7) and Azure Blob Storage for managing files. Azure Blob Storage: Azure Blob Storage is a Microsoft Cloud Storage. Azure Blob Storage is used to manage the files for storing or reading. Storage Account: A Storage account gives us a unique namespace. Every file we save or store on Azure Storage must have an address, and that address is nothing but the unique name of our Storage Account name. The combination of the storage account name and Azure blob Storage endpoint forms the base address. For example, if our storage account is named as 'my-azure-account' then the base address will be like 'https://my-azure-account.blob.core.window.net'. Containers: The Containers are just like folders. Blob: The actual item or file we will store inside of the container. Create Azure Blob Storage In Azure Portal: (Step 1)First, we have to 'Sing-Up' in 'Microsoft Azure Portal', after completing 'Sing-Up&#

.NET 7 Web API CRUD Using Entity Framework Core

In this article, we are going to implement a sample .NET 7 Web API CRUD using the Entity Framework Core. Web API: Web API is a framework for building HTTP services that can be accessed from any client like browser, mobile devices, and desktop apps. In simple terminology API(Application Programming Interface) means an interface module that contains programming functions that can be requested via HTTP calls either to fetch or update data for their 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 kinds of apps can consume it. Authentication and Authorization are easy to implement. The ideal platform to build the REST full services. Install The SQL Server And SQL Management Studio: Let's install the SQL server on our l