Permalink
Browse files

code review comments.

  • Loading branch information...
1 parent 24eba90 commit 503adf0994b8edcd89e94c43e2c3791d1d6ac1e4 @craiggwilson craiggwilson committed Jan 24, 2013
Showing with 4 additions and 22 deletions.
  1. +2 −19 MongoDB.Bson/Serialization/BsonClassMap.cs
  2. +2 −3 MongoDB.BsonUnitTests/Jira/CSharp637Tests.cs
@@ -1562,28 +1562,11 @@ private static MemberInfo GetMemberInfoFromLambda<TMember>(Expression<Func<TClas
switch (memberInfo.MemberType)
{
case MemberTypes.Field:
- memberInfo = typeof(TClass).GetField(
- memberInfo.Name,
- BindingFlags.Instance |
- BindingFlags.Public |
- BindingFlags.NonPublic);
break;
case MemberTypes.Property:
- // Handle interfaces and base classes; lambdas always
- // call the derived implementation.
- if (memberInfo.DeclaringType != typeof(TClass))
+ if (memberInfo.DeclaringType.IsInterface)
{
- var memberInfo2 = typeof(TClass).GetProperty(
- memberInfo.Name,
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
-
- // Handle explicit interface implementations.
- if (memberInfo2 == null && memberInfo.DeclaringType.IsInterface)
- {
- memberInfo2 = ResolveExplicitProperty(memberInfo, typeof(TClass));
- }
-
- memberInfo = memberInfo2;
+ memberInfo = ResolveExplicitProperty(memberInfo, typeof(TClass));
}
break;
default:
@@ -1,4 +1,4 @@
-/* Copyright 2010-2012 10gen Inc.
+/* Copyright 2010-2013 10gen Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,10 @@
* limitations under the License.
*/
-using NUnit.Framework;
-
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
+using NUnit.Framework;
namespace MongoDB.BsonUnitTests.Jira.CSharp637
{

0 comments on commit 503adf0

Please sign in to comment.