Polymorphism: Takes Many Forms.
1.Compile Time-(Early Binding/Overloading):Methods can have same name,with different number of arguments.
2.Run Time-(Late Binding/dynamic):Objects of Base Class can Point to objects of Derived class At Runtime.(using Override)
Authorize Attribute is used to restrict the controller/Action with respect to Users.
Authorize Attribute-takes Roles,Users,Order as parameters
/*Authorize users whose role is admin*/
[Authorize(Roles = "admin")]
<span style="font-style: inherit; font-weight: inherit; line-height: 1.625;">public ActionResult Index()</span>
Action Filters are Pre/Post Condition Logic before/after Action methods in Controller Executes.
Types of Action Filters(Attributes Over Action ):
Lock is a thread safe mechanism,where you allow only one thread to access a block of code(Critical Section) and block other threads,untill the current thread releases the lock(Mutual Exclusion).
// crtical section
Internally the Lock get’s translated with Monitor.Enter(Object) and Monitor.Exit(object). Lock is a wrapper/high level construct provided by C#.