Extracting property name at compile time
Just an extract from this article. It’s something I always find VERY useful (in situations where speed is not one of our concerns, of course) protected string ExtractPropertyName<T>(Expression<Func<T>> propertyExpression) { if (propertyExpression == null) { throw new ArgumentNullException("propertyExpression"); } ...
2012, Mar 28 — 2 minute read