Nginx is a high-performance, open-source web server that can also be used as a reverse proxy, load balancer, HTTP cache, and mail proxy. It is highly efficient with many simultaneous connections due to its event-driven architecture. Nginx is a core component in modern web infrastructure due to it's reliability, speed, and scalability. Nginx is available for all operating systems - Windows, Linux, macOS included.
(more…)
Testing is an important part of any application since it tells the developers that their application works correctly. In this tutorial we are going to learn the different techniques to employ in order to test Entity Framework Core codes. These techniques are broadly divided into testing with production database or without the production database. These are:
Docker Volumes are persistent data stores for containers created and managed by Docker. Volumes are stored within a directory on the host machine and not inside the container. When we mount the volume into a container, then this directory is what's mounted on the container. If an app is storing some data on files inside the container then in case of a container crash the data is bound to be lost. Volumes comes into this scenario since here we can save these files on the volumes, in case of container crash the volume is unaffected (since it is outside the container), so the files are not lost.
(more…)
Entity Framework Core (EF Core) interceptors allow interception, modification and suppression of EF Core operations. Some examples include executing a command, call to SaveChanges and so on. You can download the source code from my GitHub repository.
(more…)
Entity Framework Core Events and Diagnostic Listeners are very helpful in debugging our EF Core code. Events are called when something happens in EF Core codes. For example DbContext.SaveChangesFailed event is called when SaveChanges or SaveChangesAsync method is failed so we can use this event to find out the cause of the failure. Diagnostic listeners allow listening for any EF Core event for obtaining diagnostic information of the app. In this tutorial we are going to implement each of these 2 in our code.
Logging is an important aspect of any .NET app for debugging purpose. Through Logging we can generate SQL logs and Change Tracking information in Entity Framework Core. There are 2 types of logging in EF Core:
Entity Framework Core Change Tracker keeps track of all the loaded entities changes and these changes are applied to the database when SaveChanges method is called.
Entities are tracked on the following conditions :
Multiple users trying to update an entity data at the same time can lead to inconsistencies and data corruption. A user say Elon displays an entity data in order to update it, at this same time another user say Trump updates the same entity data before Elon saves the changes to the database. When Elon saves the data an inconsistent version is saved on the database which Elon has no knowledge. This is known as concurrency conflict.
(more…)
When building database driven apps we come across scenarios that require building complex queries with multiple data sources. Common examples of such cases being Joins, Group Joins and Group by, select many and so on. Here we look into such cases and understand how to build such complex queries in Entity Framework Core.
(more…)
It is necessary that we Optimize our Entity Framework Core codes so that the application remains light weight and at the same time executes faster. We can perform the optimizing techniques in EF Core by understanding which technique is best to use in a given situation. Let's discuss some of the most important ones one by one.
(more…)