Month: February 2018

How to implement content negotiation in ASP.NET Core 2.0

Content negotiation is one of those quality-of-life improvements you can add to your REST API to make it more user-friendly and flexible. And when we design an API, isn’t that what we want to achieve in the first place? There are many things to keep in mind when designing a REST API and we’ve written recently about it in our Top REST API best practices article. Content negotiation is an HTTP feature which has been around for a while, but for one reason or another, it is, maybe, a bit underused. In short, content negotiation lets you choose or rather “negotiate”...

Read More

.NET Core 2.0, Angular 4 and MySQL. Part 5

In the previous post, you have created a repository pattern for collecting the data from the database. Now, it is time to use that repository for the business logic. You will keep all the database logic inside the repository classes. Controllers will be responsible for handling requests, model validation and returning responses to the frontend part of the application. By doing so, your controllers won’t be overwhelmed with the code thus making the code easier to read and maintain as well. If you want to see all the basic instructions and complete navigation for this series, please follow the following...

Read More

.NET Core 2.0, Angular 4 and MySQL. Part 4

What is Repository pattern and why should you use it? With Repository pattern, we create an abstraction layer between the data access and the business logic layer of an application. By using it, we are promoting a more loosely coupled approach to access our data from the database. Also, the code is cleaner and easier to maintain and reuse. Data access logic is in a separate class, or sets of classes called a repository, with the responsibility of persisting the application’s business model. Implementing the repository pattern is our topic for this post. So let’s start. If you want to...

Read More

Newsletter

the complete guide to http