예제 #1
0
        public void Rule_Base_Testing()
        {
            var config = new TypeAdapterConfig();

            config.When((srcType, destType, mapType) => srcType == destType)
            .Ignore("Id");

            var simplePoco = new SimplePoco {
                Id = Guid.NewGuid(), Name = "TestName"
            };

            var dto = TypeAdapter.Adapt <SimplePoco>(simplePoco, config);

            dto.Id.ShouldBe(Guid.Empty);
            dto.Name.ShouldBe(simplePoco.Name);
        }