Showing posts with label Restrict MVC actions to be invoked only by GET or POST. Show all posts
Showing posts with label Restrict MVC actions to be invoked only by GET or POST. Show all posts

26 July 2014

Restrict MVC actions to be invoked only by GET or POST

Restrict MVC actions to be invoked only by GET or POST

We can decorate the MVC action with the HttpGet or HttpPost attribute to restrict the type of HTTP calls. For instance you can see in the below code snippet the DisplayCustomer action can only be invoked by HttpGet. If we try to make HTTP POST on DisplayCustomer, it will throw an error.


[HttpGet]
public ViewResult DisplayCustomer(int id)
{
    Customer objCustomer = Customers[id];
    return View("DisplayCustomer",objCustomer);
}


Consistency level in Azure cosmos db

 Consistency level in Azure cosmos db Azure Cosmos DB offers five well-defined consistency levels to provide developers with the flexibility...