File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed
MongoDB.BsonUnitTests/Jira
MongoDB.Bson/Serialization Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -1562,28 +1562,11 @@ private static MemberInfo GetMemberInfoFromLambda<TMember>(Expression<Func<TClas
1562
1562
switch ( memberInfo . MemberType )
1563
1563
{
1564
1564
case MemberTypes . Field :
1565
- memberInfo = typeof ( TClass ) . GetField (
1566
- memberInfo . Name ,
1567
- BindingFlags . Instance |
1568
- BindingFlags . Public |
1569
- BindingFlags . NonPublic ) ;
1570
1565
break ;
1571
1566
case MemberTypes . Property :
1572
- // Handle interfaces and base classes; lambdas always
1573
- // call the derived implementation.
1574
- if ( memberInfo . DeclaringType != typeof ( TClass ) )
1567
+ if ( memberInfo . DeclaringType . IsInterface )
1575
1568
{
1576
- var memberInfo2 = typeof ( TClass ) . GetProperty (
1577
- memberInfo . Name ,
1578
- BindingFlags . Instance | BindingFlags . Public | BindingFlags . NonPublic ) ;
1579
-
1580
- // Handle explicit interface implementations.
1581
- if ( memberInfo2 == null && memberInfo . DeclaringType . IsInterface )
1582
- {
1583
- memberInfo2 = ResolveExplicitProperty ( memberInfo , typeof ( TClass ) ) ;
1584
- }
1585
-
1586
- memberInfo = memberInfo2 ;
1569
+ memberInfo = ResolveExplicitProperty ( memberInfo , typeof ( TClass ) ) ;
1587
1570
}
1588
1571
break ;
1589
1572
default :
Original file line number Diff line number Diff line change 1
- /* Copyright 2010-2012 10gen Inc.
1
+ /* Copyright 2010-2013 10gen Inc.
2
2
*
3
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
4
* you may not use this file except in compliance with the License.
13
13
* limitations under the License.
14
14
*/
15
15
16
- using NUnit . Framework ;
17
-
18
16
using MongoDB . Bson ;
19
17
using MongoDB . Bson . Serialization ;
20
18
using MongoDB . Bson . Serialization . Attributes ;
19
+ using NUnit . Framework ;
21
20
22
21
namespace MongoDB . BsonUnitTests . Jira . CSharp637
23
22
{
You can’t perform that action at this time.
0 commit comments