Skip to content

Instantly share code, notes, and snippets.

@masaeedu
Created November 21, 2016 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaeedu/7150ee92becdad4e514dfa160da460ad to your computer and use it in GitHub Desktop.
Save masaeedu/7150ee92becdad4e514dfa160da460ad to your computer and use it in GitHub Desktop.
class Program
{
static void Main(string[] args)
{
var overloads = typeof(EntityFrameworkQueryableExtensions)
.GetMethods().Where(method => method.Name == "Include");
var include2 = overloads
.Where(method => method
.GetParameters()
.Select(param => param.ParameterType.IsGenericType ? param.ParameterType.GetGenericTypeDefinition() : param.ParameterType)
.SequenceEqual(new[] { typeof(IQueryable<>), typeof(string) }));
}
}
public static class EntityFrameworkQueryableExtensions
{
public static void Include<TEntity, TProperty>(this IQueryable<TEntity> source, Expression<Func<TEntity, TProperty>> navigationPropertyPath) where TEntity : class
{
}
public static void Include<TEntity>(this IQueryable<TEntity> source, string navigationPropertyPath) where TEntity : class
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment