public void Wrapper()
        {
            var model = new AugmenterWrapper <TestModel1>(new TestModel1());

            var result = TypeInfoResolver.ResolveTypeInfo(model.GetType());

            result.Should().NotBeNull();
            result.Type.Should().Be(typeof(TestModel1));
            result.IsArray.Should().Be(false);
            result.IsWrapper.Should().Be(true);
        }
Example #2
0
        public IActionResult GetWrapper()
        {
            // You can use the special AugmenterWrapper to wrap your model with
            // some configuration that will be used when doing the augmentation.
            var model   = new ModelB();
            var wrapper = new AugmenterWrapper <ModelB>(model);

            wrapper.SetTypeConfiguration(c =>
            {
                c.Add("Baz", (x, state) => x.Id);
            });

            return(Ok(wrapper));
        }