Category Archives: Web API

Web API – Custom Data Annotation

By | 06/10/2021

In this post, we will see how to create a Data Annotation custom to use in a .NET 5 Web API project.First of all, what is a Data Annotation?From Microsoft web site:“The advantage of using the Data Annotation validators is that they enable you to perform validation simply by adding one or more attributes –… Read More »

Web API – Faker.js

By | 30/06/2021

In this post, we will see how to use the Javascript library called Faker.js for generating fake data for various areas, including address, commerce, company, date, finance, image, random, or name.Here, it is possible to find the project. [HOW TO INSTALL]First of all, we have to install node.js in our system, because Faker is available as… Read More »

Web API – ASP.NET Core 5

By | 23/06/2021

In this post, we will see how to create a WebAPI application with ASP.NET 5.0.For all information about ASP.NET Core 5, we can check the Microsoft Web Site. [VISUAL STUDIO]We open Visual Studio and we select ASP.NET Core Web Api project: In Additional information, we can decide to Enable Docker and Enable OpenAPI support.With Enable… Read More »

Web API – Json Server

By | 12/05/2021

In this post, we will see how to create a full fake Rest API for testing, using a Javascript library called Json-Server.Here, it is possible to find the project. HOW TO INSTALLFirst of all, we have to install node.js in our system, because Json Server is available as a NPM package.Then, using the command npm… Read More »

Web API – Simple Versioning

By | 05/05/2021

In this post, we will see how to create a simple versioning of a Web API method, using the Routing attribute.However, before starting, I want to remember that the best way for versioning a method it was describe here: Web API – Versioning We create a Web API project called TestAPI and we add a… Read More »

Web API – Tips

By | 17/03/2021

In this post, we will see two tips that could help us in order to create Web API. First of all, we create a simple Web API for managing a list of Users: [USER.CS] [USERTYPE.CS] [IUSERCORE.CS] [USERCORE.CS] [USERCONTROLLER.CS] [STARTUP.CS] We have done and now with Postman, we will verify it works fine: TIP #1We can… Read More »