Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace System.Linq
- {
- public static class LinqExtensions
- {
- public static TResult GetProperty<TSource, TResult>(this TSource source, Func<TSource, TResult> selector)
- {
- if (source == null)
- {
- return default(TResult);
- }
- if (selector == null)
- {
- throw new ArgumentNullException("selector can't be null");
- }
- return selector(source);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment