Why are delegates reference types?

The question boils down to this: the CLI (Common Language Infrastructure) specification says that delegates are reference types. Why is this so? One reason is clearly visible in the .NET Framework today. In the original design, there were two kinds of delegates: normal delegates and “multicast” delegates, which could have more than one target in … Read more

Detailed Explanation of Variable Capture in Closures

Is tricky. Will come onto it in a minute. There’s no difference – in both cases, it’s the variable itself which is captured. Nope, no boxing occurs. It’s probably easiest to demonstrate how the capturing works via an example… Here’s some code using a lambda expression which captures a single variable: using System; class Test … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)