AutoMapper in C#

AutoMapper is an object-object mapper which allows you to solve the problem of manually mapping each property of a class with the same properties of another class. AutoMapper saves you the tedious effort of having to manually map one or more properties of such incompatible types. Before AutoMapper was introduced if we wanted to assign […]

Read More

Calculate age in years, months and days in mysql

When we are dealing with dates in mysql sometimes we need to calculate the age in years months and days directly from the mysql query We can easily achieve it from the below sql query SELECT name,dob, CONCAT(TIMESTAMPDIFF( YEAR, dob, now() ),’ Years,’, TIMESTAMPDIFF( MONTH, dob, now() ) % 12,’ Months,’, FLOOR( TIMESTAMPDIFF( DAY, dob, […]

Read More

Difference between parseInt(string) and Number(string) in JavaScript?

parseInt() parses up to the first non-digit and returns whatever it had parsed. Number() wants to convert the entire string into a number Example: parseInt(“123xyz”)      //It will returns 123 Number(“123xyz”)      //It will returns NaN

Read More

Global Exception Handling in ASP.NET Core WEB API

In my previous post, I have used multiple ways (Exception filter, Global.asax, OnException at Controller etc.,) to implement exception handling in Asp.Net MVC. Asp.Net Core comes with many in-built and ready to use middleware, and you can add them to your application in the Startup class Configure method. One of the in-bulit ASP.NET Core diagnostic […]

Read More