Minimal WebApi with ASP.NET Core (Visual Studio 2022)

Minimal WebApi with ASP.NET Core (Visual Studio 2022)
19.99 USD
Buy Now

This course is a brief course that teaches minimal web-api of ASP. NETCore. Explanation is in a simple language. Downloads have been provided with almost every chapter. Tutorials have been kept brief and to-the-point. Audio is crystal clear. Getting Started with Web ApiThis tutorial starts with a beginner’s introduction to the concept of web api. After that we create a basic structure of a project that will help us learn about various types of web api - which will be serially covered in the next coming tutorials. Minimal GET WebApi with No ParametersIn this tutorial we shall add a web api that allows us to get all the records of a table. Please do note, however, that such a query is never done in a real project - it is invariably qualified with some paramaters that return a lesser number of records. Minimal GET WebApi with a Parameter of Numeric TypeIn the previous tutorial we learned how to write a web api that accepts no parameters. We executed it to return all the records of a table. In this tutorial we shall add another web api that accepts a parameter and returns data on the basis of that parameter. Minimal GET WebApi to Find a Record by IdIn this tutorial we shall add a web api of GET type that takes an ID as a parameter and returns a record for that parameter. Using Postman to Run WebApiPostman is a software that can be used to easily and conveniently run and execute web api. It can be installed as a desktop application. The software offers a lot of functionality, but we shall be using a small part of that - relevant to just our web api needs. Minimal POST WebApi for Creating a new RecordA web api of the POST type is used to create a new record. For example, if we have to create a new record of a doctor, then we have to use a POST api to send the relevant fields for creating a record. Minimal PUT WebApi for Updating a RecordAn Http PUT request is used to update an existing record. For this, a client has to send the unique id of the record along with the entire updated record. Partial updates are not done with a PUT type of Web Api. Partial updates are, rather, supported by an HTTP PATCH request. But that is not the topic of this tutorial. Today we shall focus on the Http Put type of Web Api. Minimal DELETE WebApi for Deleting a RecordAn HTTP DELETE request is used for deleting a record. The Server sends a 200 OK response on successful deletion alongwith the item that was deleted. Alternatively, it can send 204 No Content if the deleted item is, or cannot be included in the response. Let us see the implementation in this tutorial! Over-Posting in WebApi and a Solution with Data Transfer ObjectWe have been working with a model class consisting of three properties - id, Name and Fees. All the three properties have participated and have been exposed in json communication through every Web Api that we have discussed and written in the past tutorials of this chapter. This is called over-posting. But what if there were a property such as an email address that we didn’t want exposed? This tutorial presents a solution through the concept of a Data Transfer Object. Preventing Over-Posting of a Collection in a WebApiIf an API has to return a collection of records, and if we do not want entire objects transmitted, then we can use a Data Transfer Object to return a small subset of properties, just-the-required subset. For a primer on over-posting, please refer the previous tutorial “Over-Posting in WebApi and a Solution with Data Transfer Object”.DTO Object as Argument and Return in a WebApiThis tutorial explains how to modify a POST type of WebApi so that it doesn’t over-post data. A POST WebApi receives a data object as a parameter, and then adds it to a database, and finally it returns an HTTP 201 Created response alongwith the json for the newly added object. We have already covered this in one of the previous tutorials and for a primer on over-posting, please refer a previous tutorial “Over-Posting in WebApi and a Solution with Data Transfer Object”.Calling a GET WebApi from a C++ WinRT AppThis tutorial explains how a GET web api can be called from a C++ WinRT application. I have chosen WinRT type because it contains a lot many pre-written functions that simplify internet access and json parsing. I won’t be able to explain the details of a WinRT setup, so I have already created a WinRT console application that connects to our web api, and then obtains a string from the application, and then parses the json contained in that string. The c++ project has been provided in the downloads attached to this course. Calling a POST WebApi from a C++ WinRT AppThis tutorial explains how a POST web api can be called from a C++ WinRT application. I have created a WinRT console application that connects to, and posts a json string to a POST web api, and then obtains a string response from the application, and then parses the json contained in that string. The c++ project is available in your downloads. OpenAPI and Swagger for Web API DocumentationSwagger makes it easy to document the various We