ASP.NET MVC: Display Total and Avg in Table footer in Razor Views

There are various cases in which you may want to display results from aggregate functions (Sum, Avg, Count, Min, Max) performed over the columns in the grid in their footer. This post explains how to display aggregate functions in ASP.NET MVC Razor views.

Used Environment for this post: VS 2015 Update 3, ASP.NET MVC 5

For ASP.NET Web Forms, Read following post:
Displaying Total in ASP.NET Gridview Footer Row Without using Template Field

Azure Functions + Cognitive Services: Automate Image Moderation

Generally, User submitted images (profile pictures, social media posts, and business documents) are needed to be moderated to protect business and quality. If a large number of images are submitted in an application then manual moderation is time consuming and is not instantaneous. This post explains how to automate image moderation using Azure functions and Cognitive Services. Automated moderation applies machine learning and AI to cost-effectively moderate at scale, without human involvement.

Generalize a method to read any master table with C# and Dapper

On a web page or application form, it is common to have different master data like Country, State…etc. available in dropdownlist, listbox or any other control. It is needed to read all master data from database and bind to proper controls. This post explains different ways to read master tables with C# and Dapper.

ASP.NET Core Identity: Allow Login with either Email or Username

Do you want to allow user to login with either Username or Email address? ASP.NET Identity uses Username for Signin verification and In default Core template, Email is used as Username. In this post, we will change ASP.NET Core Identity setup to allow both Username and Email on login.

Assumptions:
1. Username is unique for each user. It is either input by user or generated by application on registration.
2. No @ symbol allowed in Username.

ASP.NET Core MVC: Enums with Select TagHelper

In this post, we will see how to use select tag helper in ASP.NET Core MVC and how to bind select tag helper to model data or enum values. The following environment is used for this post:

ASP.NET Core 1.0.1
Dapper 1.50.2
Visual Studio 2015 update 3

For the demo, let us assume we have following Department enum