Thursday, April 16, 2015

Object Properties with Get, Set

var d = Date.prototype;
Object.defineProperty(d, "Year", {
  get: function() {return this.getFullYear() },
  set: function(y) { this.setFullYear(y) }
});
Above code add property in Date object. This is use of getter and setter in a Date object: Shown in below lines of code. 
var now = new Date;
document.write(now.Year + '<br/>'); // 2015
now.Year = 2016;
document.write(now); 
// Sat Apr 16 2016 13:56:25 GMT+0500 (Pakistan Standard Time)

Asp.Net MVC (5) - Exception Filter - HandleError

Applicable on Asp.Net MVC5 HandleError Filter This belongs to Exception Filters category (Authentication Filter, Authoriz...