What is MVC?

MVC stands for Model – View – Controller.

  • It is architecture for developing interactive applications where there would be a user interaction involved and event handling would occur.

What is a role of Model, View and Controller?

Model: It manages data basically state of the application in memory. There is no fixed size or shape of model objects since what we intend to hold in memory in one application may not be the same as that in other application. It includes all of an application’s validation logic, business logic and data access logic. For example, an Employee object (Model) might retrieve information from a database, operate on it, validate it and then write updated information back to an Employee table in the database. Continue reading “What is MVC?”

Please follow and like us:
0

Asp.Net MVC Exploring Controllers in depth Part 9

Asynchronous Controllers

 

  • The async actions are useful only when you are performing I/O bound operations such as remote server The benefit of the async call is that during the I/O operation, no ASP.NET worker thread is being used.
  • The asynchronous controller enables you to write asynchronous action
  • Suppose we have three operations which takes 200, 500 and 800 milliseconds. With the synchronous call, total response time would be slightly more than 1500 milliseconds. However, if the calls are made asynchronously (in parallel), total response time would be slightly more than 800 milliseconds, because that is the duration of longest task/operation. Continue reading “Asp.Net MVC Exploring Controllers in depth Part 9”
Please follow and like us:
0

Asp.Net MVC Exploring Controllers in depth Part 8

Cancelling Filter Execution

  1. You can cancel filter execution in the OnActionExecuting methods by setting the Result property to a non-null value.
  • Any pending OnActionExecuted and OnActionExecuting filters will not be invoked
  • Invoker will not call the OnActionExecuted method for the canceled filter or for pending
  • The OnActionExecuted filter for previously run filters will
  • All of the OnResultExecuting and OnResultExecuted filters will
  1. You can cancel filter execution in the OnResultExecuting methods by setting the Cancel property.
Please follow and like us:
0

Asp.Net MVC Exploring Controllers in depth Part 7

Filter Overrides in ASP.Net MVC 5.X

Filter Overrides in ASP.NET MVC 5 are very useful when we are implementing a global or controller level filter and we do not want to apply an action filter on some Action methods in the controller. This feature is useful for removing the headache of applying filters for each and every action where we need to exclude only a few actions.

  • Authorization filters
  • Action filters
  • Result filters
  • Exception filters

We have five type filter overrides corresponding to this:

  • OverrideAuthenticationAttribute
  • OverrideAuthorizationAttribute
  • OverrideActionFiltersAttribute
  • OverrideResultAttribute
  • verrideExceptionAttribute

Continue reading “Asp.Net MVC Exploring Controllers in depth Part 7”

Please follow and like us:
0