Example #1
0
        public string GetVo4()
        {
            var expando = new ExpandoModel();

            expando.AddPropertyFilter(ExpandoPropertyFilterFactory.CreateExcludeFilter("bad"));
            expando.Set("A", () => Task.FromResult("abc"));
            expando.Set("B", async() => await Task.FromResult("abc"));
            expando.Set("bad", () => Task.FromResult("bad"));
            return(JsonConvert.SerializeObject(expando, Formatting.Indented));
        }
Example #2
0
        public string GetVo3()
        {
            var expando = new ExpandoModel();

            expando.AddPropertyFilter(ExpandoPropertyFilterFactory.CreateExcludeFilter("bad"));

            dynamic dynamicVo = expando;

            dynamicVo.a    = "222";
            dynamicVo.bad  = "bad";
            dynamicVo.good = "good";
            return(JsonConvert.SerializeObject(expando, Formatting.Indented));
        }