Development With A Dot

Blog on development in general, and specifically on .NET

Sponsors

News

My Friends

My Links

Permanent Posts

Portuguese Communities

Browse by Tags

All Tags » Reflection (RSS)
Mapping Non-Public Members With Entity Framework Code First
This is a common request, and really makes sense; we need to use LINQ expressions and a bit of reflection magic. First, an helper function for returning an expression that points to a member: 1: public static class ExpressionHelper 2: { 3: public static...
NDepend 4 – First Steps
Introduction Thanks to Patrick Smacchia I had the chance to test NDepend 4 . I can only say: awesome! This will be the first of a series of posts on NDepend, where I will talk about my discoveries. Keep in mind that I am just starting to use it, so more...
Dynamic LINQ Methods
Continuing the Dynamic LINQ series, here are some hopefuly useful methods for performing LINQ queries in IQueryable or IQueryable<T> object, with String parameters. The available methods, so far, are: GroupBy OrderBy Skip Take WhereEquals WhereNotEquals...
Enhanced Dynamic Filtering
Remember my last post on dynamic filtering? Well, this time I'm extending the code in order to allow two levels of querying: Match type, represented by the following options: public enum MatchType { StartsWith = 0, Contains = 1 } And word match: public...
Dynamic Filtering
Continuing my previous posts on dynamic LINQ , now it's time for dynamic filtering. For now, I'll focus on string matching. There are four standard operators for string matching, which both NHibernate, Entity Framework and LINQ to SQL recognize: Equals...
Dynamic LINQ in an Assembly Near By
You may recall my post on Dynamic LINQ . I said then that you had to download Microsoft's samples and compile the DynamicQuery project (or just grab my copy ), but there's another way. It turns out Microsoft included the Dynamic LINQ classes in the System...
Dynamic Paging and Sorting
Since .NET 3.5 brought us LINQ and expressions, I became a great fan of these technologies. There are times, however, when strong typing cannot be used - for example, when you are developing an ObjectDataSource and you need to do paging having just a...
Yet Yet Another Way To Create An Object
Yep, there's still another one: FormatterServices . This one allows one to create an object without running it's constructor... it is used by some of our good friends serializers . Stopwatch watch = new Stopwatch(); for (Int32 i = 0; i Beware, though...
Yet Another Way To Create An Object
After I wrote this post , I come up with yet another way to create an object... Here it is: Stopwatch watch = new Stopwatch(); ConstructorInfo ci = typeof(StringBuilder).GetConstructor(new Type[0]); NewExpression expr = Expression.New(ci); Func<StringBuilder>...
Three Ways To Create An Object
Enjoy! Type type = typeof(StringBuilder); //can be any type ConstructorInfo ci = type.GetConstructor(new Type [ 0 ]); Stopwatch watch = new Stopwatch(); watch.Start(); for (Int32 i = 0; i < 100; ++i) { StringBuilder obj = Activator.CreateInstance(type...
More Posts