title: LINQ to Entities does not recognize the method Boolean IsAssignableFrom
body: <p>I have an extension method IsAssignableFrom</p>
  
  <pre><code>public static bool IsTypeOf&lt;T&gt;(this Type type)
          {
              return typeof (T).IsAssignableFrom(type);
          }
  </code></pre>
  
  <p>Which is called by:</p>
  
  <pre><code>var Type = typeof(BadgeNumVotesOnItem);    
  var UnlockableBadges = DB.Badges.Where(t =&gt; t.GetType().IsAssignableFrom(Type));
  </code></pre>
  
  <p>However when I use it, it is throwing this exception:</p>
  
  <pre><code>{System.NotSupportedException: LINQ to Entities does not recognize the method 'Boolean IsAssignableFrom(System.Type)' method, and this method cannot be translated into a store expression.
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)
     at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding&amp; binding)
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression&amp; source, DbExpressionBinding&amp; sourceBinding, DbExpression&amp; lambda)
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)
     at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
     at System.Data.Objects.ELinq.ExpressionConverter.Convert()
     at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
     at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
     at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator()
     at System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator()
     at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator()
     at MVCDaemon.Helpers.AwardBadgesProcessor.AwardBadgesForEventViewedSituation() in c:\Users\William-Business\Desktop\TWB\Entrepreneurial dev\Hehe\Hehe.Daemon\Processors\hehehe.cs:line 27
     at MVCDaemon.Controllers.AwardBadgesController.FromUnprocessedEvents() in c:\Users\William-Business\Desktop\TWB\Entrepreneurial dev\Hehe\Hehe.Daemon\Controllers\hehehe.cs:line 29}
  </code></pre>