title: Queryable.Aggregate is not working with null values
body: <p>I'm writing a visitor which transforms <code>IQueryable</code> query. It uses <code>Aggregate</code> method with seed <code>null</code> and then use some func to transform it. My problem is that this null is of type <code>decimal?</code>. But I get an exception</p>
  
  <pre><code>'Expression of type 'System.Object' cannot be used for parameter of type 
  'System.Nullable`1[System.Decimal]' of method 'System.Nullable`1[System.Decimal] 
  Aggregate[Nullable`1,Nullable`1]
  (System.Linq.IQueryable`1[System.Nullable`1[System.Decimal]], 
  System.Nullable`1[System.Decimal], 
  System.Linq.Expressions.Expression`1[System.Func`3[System.Nullable`1[System.Decimal],
  System.Nullable`1[System.Decimal],System.Nullable`1[System.Decimal]]])''
  </code></pre>
  
  <p>After some research I found that it's <code>Aggregate</code> itself which is ruining my query:</p>
  
  <pre><code>public static TAccumulate Aggregate&lt;TSource,TAccumulate&gt;(this IQueryable&lt;TSource&gt; source, TAccumulate seed, Expression&lt;Func&lt;TAccumulate,TSource,TAccumulate&gt;&gt; func) {
      if (source == null)
          throw Error.ArgumentNull("source");
      if (func == null)
          throw Error.ArgumentNull("func");
      return source.Provider.Execute&lt;TAccumulate&gt;(
          Expression.Call(
              null,
              GetMethodInfo(Queryable.Aggregate, source, seed, func),
              new Expression[] { source.Expression, Expression.Constant(seed), Expression.Quote(func) }
              ));
  }
  </code></pre>
  
  <p>My problem is with <code>Expression.Constant(seed)</code> which is <code>null</code> and <code>Expression.Constant</code> transforms it into constant of type object:</p>
  
  <pre><code>public static ConstantExpression Constant(object value) {
      return ConstantExpression.Make(value, value == null ? typeof(object) : value.GetType());
  }
  </code></pre>
  
  <p>Thus my <code>new decimal?()</code> transforms into <code>(object) null</code> and I get this error.</p>
  
  <p>Is there any workaround for this? It seems to be impossible to get fix in .net framework (and even if it's possible, it will be fixed in 4.7 or later). I'l create a pull request for this however I'm sure it won't be accepted. </p>
  
  <p>Code snippet to reproduce:</p>
  
  <pre><code>var result = new int?[] {1}.AsQueryable().Aggregate(default(int?), (a, b) =&gt; b);
  </code></pre>