How to use AngularJS in ASP.NET MVC and Entity Framework

Read full article on the Infragistics blog These days, it seems like everyone is talking about AngularJS and ASP.NET MVC. So in this post we will learn how to combine the best of both worlds and use the goodness of AngularJS in ASP.NET MVC by demonstrating how to use AngularJS in an ASP.NET MVC application. … Continue reading How to use AngularJS in ASP.NET MVC and Entity Framework

Step by Step implementing Onion architecture in ASP.NET MVC Application

Source Code on the GitHub Learn Creating N-Tier Applications in C#, Part 1 by Steve Smith here - I learnt lot from this course hence sharing Recently I gave a talk on Onion Architecture in MVC application to the audience of 300 at the C-Sharpcorner conference 2015. Talk was well received and I had a … Continue reading Step by Step implementing Onion architecture in ASP.NET MVC Application

How do I setup ASP.NET Identity 2.0 to use my own connection string

By default ASP.NET Identity 2.0 creates the database inside the App_Data directory of the application. ASP.NET identity 2.0 works on the Entity Framework Code First approach and it reads the connection string mentioned in the web.config as shown below, In the ApplicationDbContext class you can find that connection string named DefaultConnection has been used. You … Continue reading How do I setup ASP.NET Identity 2.0 to use my own connection string

How to create a Container in Azure Storage from MVC application

I am working on a MVC application in which I need to work with Microsoft Azure storage .I had a requirement to create An Azure storage container from the MVC application. In this post I will share my learning that how I created a container programmatically. I created the view as shown in below image. … Continue reading How to create a Container in Azure Storage from MVC application

Child Actions in ASP.NET MVC

Read full post on falafel blog Child Actions are the action methods which can be invoked within the view. This is used to work with the data in the view, which are not related to the main action method. For example, if you want to create a data driven widget in the view using data … Continue reading Child Actions in ASP.NET MVC

Check User exists in a Role in ASP.NET Identity 2.0

Read full post on Falafel blog ASP.NET MVC5 uses Identity 2.0 to manage the users and their roles. There may be scenario to check whether the currently logged in user or any user with the id exists in the given role or not, and checking can be done either in the controller class or in … Continue reading Check User exists in a Role in ASP.NET Identity 2.0

Start-up code using WebActivator in MVC application

Read full post on Falafel blog WebActivator allows us to execute a code long before application start-up. There may be requirements when you need to load external assemblies or instantiate a particular object before the application start up. You need to make sure some codes execute before the codes inside the App_Start folder and the … Continue reading Start-up code using WebActivator in MVC application

Custom Action Filter in ASP.NET MVC 5

Read full article on Falafel blog here ASP.NET MVC 5 provides five different kinds of Filters. They are as follows: Authentication [Introduced in MVC5] Authorization Action Result Exception Filters are used to inject logic at the different levels of request processing. Let us understand where at the various stages of request processing different filters get … Continue reading Custom Action Filter in ASP.NET MVC 5

Convert User to ApplicationUser in ASP.Net MVC

In the last post I talked about How to get current user in ASP.Net MVC 5 . Type of the current user is IPrincipal which is shown as follows: You may come across requirement to work with ApplicationUser which is created as follows: You can covert returned User to ApplicationUser as follows: To convert create … Continue reading Convert User to ApplicationUser in ASP.Net MVC

How to get current user in ASP.Net MVC 5

There are two simple ways to get current user in MVC 5. If you are inside the controller class current user can be fetched as follows, Do not forget to add namespace,   Other scenario could be that you are not inside the controller class and want to fetch the user information. You can fetch … Continue reading How to get current user in ASP.Net MVC 5