Latest Posts On Code Maze

Angular HttpClient, Services and Environment Files

Angular HttpClient, Services and Environment Files

While sending HTTP requests to our server, we need to use the Angular HttpClient. Of course, we may handle all the HTTP requests from every component and process the response as well, but it is not a good practice. It is much better to make the repository for your...

Angular Components and Project Preparation

Angular Components and Project Preparation

Angular project preparation can vary from project to project and from version to version, and this article is dedicated to that topic. Creating the server part (.NET Core Web API part) is just half of the job we want to accomplish. From this point onwards, we are...

POST, PUT, and DELETE in ASP.NET Core Web API

POST, PUT, and DELETE in ASP.NET Core Web API

A write action in an ASP.NET Core Web API does four things: it accepts a DTO from the request body, validates it, asks the repository to stage the change, and returns a status code that tells the client what happened. POST returns 201 Created, PUT and DELETE return...

Content Negotiation in Web API

Content Negotiation in Web API

Content negotiation is the process of selecting the best resource for a response when multiple resource representations are available. Content negotiation is an HTTP feature that has been around for a while, but for one reason or another, it is, maybe, a bit...

ASP.NET Core Web API GET Requests With a Repository

ASP.NET Core Web API GET Requests With a Repository

A controller action in an ASP.NET Core Web API does three things: it matches a route, it asks a repository for data, and it returns that data with a status code. Everything else belongs somewhere other than the controller. In this part we build the three GET endpoints...

Repository Pattern in .NET Core Web API

Repository Pattern in .NET Core Web API

The repository pattern puts one layer between the code that needs data and the code that talks to the database. Controllers call IOwnerRepository; only the repository knows that EF Core is underneath. In this part we build that layer for our ASP.NET Core Web API: the...

Top REST API Best Practices

Top REST API Best Practices

Many giants like Facebook, Google, Github, Netflix, Amazon, and Twitter have their own REST(ful) APIs that you can access to get or even write data. But why all the need for REST? Is it that good and why is it so prevalent? Surely it's not the only way to convey...

NLog in ASP.NET Core Web API: Logging to a File

NLog in ASP.NET Core Web API: Logging to a File

ASP.NET Core ships logging in the box. We inject ILogger<T> into a class, call it, and the messages go wherever the registered providers send them: the console by default, and nowhere durable. NLog is one of those providers, and it is the one that writes files....

SQL Server With ASP.NET Core: Creating the Database

SQL Server With ASP.NET Core: Creating the Database

The ASP.NET Core Web API we build across this series reads and writes two SQL Server tables: Owner, holding a person, and Account, holding the accounts that person owns. One owner has many accounts, and that single relationship is the whole data model. This part...

A Few Great Ways to Consume RESTful API in C#

A Few Great Ways to Consume RESTful API in C#

By taking a path of Web development, you find yourself in need of dealing with external APIs (Application Programming Interface) sooner or later. In this article, my goal is to make the most comprehensive list of ways to consume RESTful APIs in your C# projects and...

Top 8 Continuous Integration Tools

Top 8 Continuous Integration Tools

If you are familiar with the concept of Continuous Integration we can agree that using it has become mandatory. There are many Continuous Integration tools out there, and in this article, we will go through some of the greatest tools available on the market and see...

What Is Continuous Integration and Why Do You Need It?

What Is Continuous Integration and Why Do You Need It?

While not every project is destined to achieve great success, there are software methodologies and practices that can dramatically increase the chance of success of a project and make the development a more pleasurable experience. One of such practices is Continuous...