Exemple #1
0
        private static IEnumerable <DynamicObject> ReMapCollection(DynamicObject dynamicObject)
        {
            var mapper = new DynamicObjectMapper();
            var items  = mapper.Map(dynamicObject);

            return(mapper.MapCollection(items));
        }
Exemple #2
0
        public When_mapping_collection_from_list_of_known_types()
        {
            sourceObjects = new[]
            {
                new CustomReferenceType {
                    Int32Property = 1, StringProperty = "One"
                },
                new CustomReferenceType {
                    Int32Property = 2, StringProperty = "Two"
                },
            };

            var mapper = new DynamicObjectMapper(isKnownTypeProvider: new IsKnownTypeProvider());

            dynamicObjects = mapper.MapCollection(sourceObjects);
        }