CSharpFeeds - All your C# feeds in one place.

Wednesday, January 06, 2010

Getting Information About Objects, Types, and Members with Expression Trees

by Alexandra Rusina via C# Frequently Asked Questions : on 1/6/2010 7:49:00 PM

Starting with C# 3.0 and Visual Studio 2008, you can use expression trees to get information about objects, types, and members. In this post I’m going to show some examples and explain what benefits you can get by using this technique. If you are not familiar with expression trees, I would recommend reading Charlie Calvert’s blog post Expression Tree Basics first. Let’s start with a simple task. Assume that you want to print the name of a field or a property next to its value. For example, imagi ...

[ read more ]

Not implemented? Implemented.

by Patrik Hägne via Legend and truth on 1/6/2010 11:13:00 AM

I use the System.NotImplementedException a lot, whenever I create a new method I have it throwing this until I have let tests drive actual functionality of the method. There is a slight danger in this though (although better than the alternative) in that I might forget to implement a function and this exception creeps into production. The other day I modified the snippet I use so that it outputs pre processor directives, so that the compiler will refuse to compile the code if I forget to impleme ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us