Is it possible to default mutiple value by only one related attribute? I find setting it row by row is a bit boilerish.
public class FooBarCounter{
[Key]
public int id{ get; set; }
[DefaultValue(0)]
public int FooCounter1 { get; private set; }
[DefaultValue(0)]
public int FooCounter2 { get; private set; }
[DefaultValue(5)]
public int BarCounter1 { get; private set; }
[DefaultValue(5)]
public int BarCounter2 { get; private set; }
}
Edit:
So the [Attrib] is in every second row, i would rather like something like this:
[Authorize]
public class MyFullyAuthorizedClass : Controller {
//props, methoods etcetc
}
Here the [Authorize] affects the entire class, like if i would put it before every methood, now thats not the best either, since i have multiple defaults, but it's only 1 line, not a boiler in every secont line. Hope i'm clearer now.
Any ideas?