Permalink
Browse files

Now supporting Equals on an instance, as well as static Equals

  • Loading branch information...
1 parent 09f974e commit 3c6f00f3ef7c31e667fe694064ddcd53ad28df33 @ayende ayende committed Nov 9, 2011
Showing with 12 additions and 2 deletions.
  1. +11 −1 Raven.Client.Lightweight/Linq/RavenQueryProviderProcessor.cs
  2. +1 −1 Raven.Tests/MailingList/Rob.cs
@@ -569,7 +569,17 @@ private void VisitMethodCall(MethodCallExpression expression)
{
if (expression.Method.DeclaringType == typeof(object) && expression.Method.Name == "Equals")
{
- VisitEquals(Expression.MakeBinary(ExpressionType.Equal, expression.Arguments[0], expression.Arguments[1]));
+ switch (expression.Arguments.Count)
+ {
+ case 1:
+ VisitEquals(Expression.MakeBinary(ExpressionType.Equal, expression.Object, expression.Arguments[0]));
+ break;
+ case 2:
+ VisitEquals(Expression.MakeBinary(ExpressionType.Equal, expression.Arguments[0], expression.Arguments[1]));
+ break;
+ default:
+ throw new ArgumentException("Can't understand Equals with " + expression.Arguments.Count + " arguments");
+ }
return;
}
if (expression.Method.DeclaringType == typeof(LinqExtensions))
@@ -15,7 +15,7 @@ public void CanUseIndex()
{
using (var store = NewDocumentStore())
{
- IndexCreation.CreateIndexes(Assembly.GetExecutingAssembly(), store);
+ new Article_Index().Execute(store);
using (var session = store.OpenSession())
{

0 comments on commit 3c6f00f

Please sign in to comment.