ASP.NET Core Parameter Validation

ASP.NET Core Model Validation

In ASP.NET, you can validate your models by applying data annotations on the properties of the class. For example, Required and BindRequired are the most commonly used validations. There are several ways to validate the values sent by users. The most commonly used methods are the validation attributes and the FluentValidation library. Data annotations You decorate your properties with the … Read more

Required and BindRequired Data Annotations

Required and BindRequired dotnet attributes

In ASP.NET, we have Data Annotations, which are attributes that can be placed above properties or classes to validate them. The default annotations are simple because ASP.NET will create the validation needed for the server and client side. The most used data annotation is [Required]. This validation has a downside, and I have seen it many times from junior programmers. … Read more

Host your ASP.NET Core on Cloud using Nginx and Docker

Docker ASP.NET Core Getting Started

In today’s article, I will show you how to host your website on DigitalOcean’s clouding host ($100 free credit)¬†using Docker containers and Nginx reverse proxy. Configure Docker for ASP.NET Core What is Docker? The containers permit to isolate the application resources, allowing at the same time the sharing of the server resources. There are similar to virtual machines but instead … Read more

SQL Indexes

What are SQL Indexes? Indexes are used to help the SQL engine to identify faster the required data. There are associated with the data from the tables or the views. If you don’t have indexes on your columns that you use in the WHERE clause, then the database server has to query the entire table. For instance, you have a … Read more

Configure NLog in .NET Core Application

Nlog Advance Logging

NLog is a C# library used for logging. It is highly configurable, used by many projects. It supports by default various destinations for logs. I recommend using the NLog or Serilog. These two libraries are very similar and they have the most number of destinations already implemented. NLog configuration The configuration is built on three major properties: Target property sets … Read more