Using Linq expression with Funcs

Here’s something I’ve found recently when playing around with Funcs. I wanted to determine what property off an object was being used inside a func, as I was trying to do something similar to a Fluent Nhibernate mapping.

e.g. say have a class call MyEntity

public class MyEntity{
public long Id {get;set;}
public string Name {get;set;}
}

To determine which property is being called, the trick is to use Linq Expressions.

Advertisements
Using Linq expression with Funcs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s