Fresh from Twitter, here are some ways to use attributes in C# that you might not know ...
Did you know you can put attributes on method parameters ...
public string MyMethod([MyCustomAttribute] int id)
{
// ...
}
Did you know you can specify an attribute on the return of a method ...
[return: CrazyAttributeOnAReturnMethod(WithAParameterOfItsOwn = true)]
public string MyMethod(int id)
{
// ...
}
For the record: I knew the first, but not the second ...
Recent comments
3 weeks 4 days ago
3 weeks 4 days ago
3 weeks 5 days ago
3 weeks 5 days ago
7 weeks 5 days ago
8 weeks 4 days ago
9 weeks 1 day ago
9 weeks 1 day ago
11 weeks 2 days ago
11 weeks 4 days ago