Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 3c6f00f3ef7c31e667fe694064ddcd53ad28df33 1 parent 09f974e
@ayende ayende authored
View
12 Raven.Client.Lightweight/Linq/RavenQueryProviderProcessor.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))
View
2  Raven.Tests/MailingList/Rob.cs
@@ -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())
{
Please sign in to comment.
Something went wrong with that request. Please try again.