Category Archives: ASP.NET MVC

ASP.NET MVC TutorialLearn ASP.NET MVC in simple and easy way from basic to advanced concepts with well explained examples and Source Code for Software Developers, Professionals and Architects. ASP.NET MVC is a web development framework combines the features of MVC (Model-View-Controller) architecture, the most up-to-date ideas and techniques from Agile development and the best parts of the existing ASP.NET platform.

LINQ Single vs SingleOrDefault vs First vs FirstOrDefault

Single(), SingleOrDefault(), First() and FirstOrDefault() are extension methods of the Enumerable class. Many people get confused about the difference between Single, SingleOrDefault, First, and FirstOrDefault methods in Linq. Let’s understand the difference between all these methods as below: Single() SingleOrDefault() First() FirstOrDefault() Description Returns a single, specific element of a sequence Returns a single, specific… Read More »

Difference between Lazy Loading and Eager Loading

Lazy/Deferred Loading In lazy loading, related objects (child objects) are not loaded automatically with its parent object until they are requested. By default LINQ supports lazy loading. With Lazy Loading, we only retrieve just the amount of data, which we need in a single query. When we need more data related to the initial data,… Read More »

Automapper in ASP.NET Core

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. Read in details. How to use Automapper in ASP.NET Core 1) Add the main AutoMapper Package to your solution via NuGet. PM> Install-Package AutoMapper or   2)  Add… Read More »

How to change the Action name in ASP.Net MVC

ActionName attribute can be used for changing the action name. Below is the sample code snippet to demonstrate more : [ActionName(“TestActionNew”)] public ActionResult Test() { return View(); } So in the above code snippet “Test” is the original action name and in “ActionName” attribute, name – “TestActionNew” is given. So the caller of this action… Read More »

How to Overload the Action Method in ASP.NET MVC

In this article, we will learn how to overload an action method in asp.net MVC with example. In Asp.Net MVC, We can overload an Action method via action name attribute . Action methods must be public because private reflection isn’t permitted in medium trust. Action methods cannot be static because all the useful properties that hang… Read More »

Child Action Methods in ASP.Net MVC

In this article, We will learn how to use and where to use Child Action methods. A ChildAction method is an action method which can be accessible from the View only and restricts us to access via an URL. If we try to invoke this action via an URL then it prompts us an error message. We… Read More »

Token Based Authentication using ASP.NET Web API 2, Owin, and Identity

As I stated before we’ll use token based approach to implement authentication between the front-end application and the back-end API, as we all know the common and old way to implement authentication is the cookie-based approach were the cookie is sent with each request from the client to the server, and on the server it is… Read More »

Routing in MVC

Routing is a pattern matching system that handles the incoming request and figure out what to do with that request. At runtime, Routing engine use the Route table for matching the incoming request’s URL pattern against the URL patterns defined in the Route table. In Convention based routing, We need to define routes in the… Read More »

Asp.Net MVC 6 new feature

Cloud-optimized Framework:  Asp.NET MVC 6 (vNext) includes new cloud-optimized versions of MVC, Web API, Web Pages, SignalR, and Entity Framework. .NET vNext support true side-by-side deployment. If your app is using cloud-optimized subset of .NET vNext, you can deploy all of your dependencies including the .NET vNext (cloud optimized) by uploading bin to hosting environment. In… Read More »