From 52dc59aa1447e41f4229b4db0f1fed4ce94b1116 Mon Sep 17 00:00:00 2001 From: Yuriy Anisimov Date: Sun, 15 Nov 2015 14:06:37 -0800 Subject: [PATCH] When using fields - not properties inside of ".Member" - throws Exception #59 --- ExpressMapper NET40/MemberConfiguration.cs | 12 ++++++++++-- ExpressMapper.Tests NET40/BasicTests.cs | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ExpressMapper NET40/MemberConfiguration.cs b/ExpressMapper NET40/MemberConfiguration.cs index 4beb91e..558f30f 100644 --- a/ExpressMapper NET40/MemberConfiguration.cs +++ b/ExpressMapper NET40/MemberConfiguration.cs @@ -59,7 +59,11 @@ public IMemberConfiguration Member(Expression Function(Expression(); + Mapper.Register() + .Member(t => t.Id, t => t.Id) + .Function(t => t.Name, t => t.Name); + Mapper.Register(); + Mapper.Register(); + Mapper.Compile(); + + var srcAndDest = Functional.FieldsTestMap(); + + var bvm = Mapper.Map(srcAndDest.Key); + + Assert.AreEqual(bvm, srcAndDest.Value); + } + [Test] public void MappingOrderLessTest() {