Sunday, January 4, 2015

MVC 5 Interview Questions and Answers

What are the new features in Asp.Net MVC5 ?
  • Introducing One ASP.NET
  • Introducing Asp.Net One Identity
  • Introducing Bootstrap in the MVC template
  • Introducing Filter overrides (Overriding filters)
  • Introducing Authentication Filters
  • Introducing Web API 2
  • Introducing OAuth 2.0 Authorization in MVC 5
  • OData Improvements in MVC 5(Full support for $select, $expand, $batch, and $value)
  • Introducing ASP.NET SignalR 2.0

ASP.NET Web API 2

  • Attribute routing

What is One ASP.NET ?

Web MVC project templates integrated with the new One ASP.NET experience. we can customize our MVC project and configure authentication by using One ASP.NET project creation wizard.

One ASP.NET

=> Asp.Net + Site + Services + Web Forms + Web Pages + Single Page + MVC + Web API + Single R

What is the structure of ASP.NET MVC 5 and release’s ?

One ASP.NET release Summary

What’s Bootstrap is new MVC 5 ?
MVC project template is updated in MVC 5 to use Bootstrap for better look and feel. Now you can easily customize. For more information

Bootstrap In Short:

  • With the updated MVC template, You can do Customization very easily
  • Better look and feel.

What is ASP.NET Web API 2 ?

Self-Hosted Web API
  • Multiple Routes (Get Routes) on an Action
  • Route Defaults (With Default Parameters)
  • Route Parameters as optional
  • Route Constraints
  • Chaining and Combining with Defaults and Optionals
  • Named Routes
  • Route Prefixe (New Attribute)
[RoutePrefix(“Blog/{BlogId}”)]
public class BlogController : ControllerBase
{
GET(“Blogs”)]
public ActionResult Index(int BlogId) { /* … */ }
}

What are new updates in ASP.NET MVC 5 Areas ?

  • Overriding the Area URL Prefix
  • Ignoring Area URLs for Certain Routes

What are advanced features of ASP.NET MVC 5 ?

  • Localizing URL’s
  • Newly Added provider FluentTranslationProvider
  • Newly Route Convention Attribute
  • Subdomain Routing

Localizing URL’s

We can localize our URL’s using an AttribtueRouting translation provider. A translation provider is useful to work against resx files, databases, etc. To create our own, simply extend
routes.MapAttributeRoutes(myConfig =>
{
myConfig.AddTranslationProvider(new MyCustomTranslationProvider());
});

Route Convention Attribute Attribute

public class MyRouteConventionAttribute : RouteConventionAttributeBase
{
public override IEnumerable
GetRouteAttributes(MethodInfo actionMethod)
{
// TODO: Yield IRouteAttributes (GET/POST/PUT/DELETE/Route).
}
}

Subdomain Routing

Wc can map our ASP.NET MVC areas to subdomains by using the Subdomain property of the RouteAreaAttribute. Doing so ensures that the routes for the area are matched only when requests are made to the specified subdomain. Here’s how:
[RouteArea(“Users”, Subdomain = “users”)]
public class SubdomainController : Controller
{
[GET(“”)]
public ActionResult Index() { /* … */ }
}
Is OAuth 2.0 support’s for Web API and Single Page Application ?
The MVC Web API and Single Page Application project templates now support authorization using OAuth 2.0. OAuth 2.0 is a authorization framework for authorizing client access to protected resources. It works for a variety of clients like for different browsers & mobile devices.
What are the OData Improvements ?

Full Support for $select, $expand, $batch & $value
Much improved extensibility
Type less support (No need to define CLR types)

No comments:

Post a Comment