Example #1
0
        public void Can_get_property_for_subtypes()
        {
            var properties = new DynamicPropertyProvider();

            properties.Add(DynamicProperty.For <Person>("Test", p => 0));

            DynamicProperty property;

            Assert.True(properties.TryGetProperty(typeof(Employee), "Test", out property));
        }
Example #2
0
        public void Can_add_dynamic_property_to_object_in_viewmodel()
        {
            dynamic viewmodel = new DynamicViewModel();

            viewmodel.Customer = new Customer {
                Id = 1
            };
            viewmodel.Add(DynamicProperty.For <Customer>("Url", c => "/customer/" + c.Id));

            Assert.Equal("/customer/1", viewmodel.Customer.Url);
        }
Example #3
0
 public DynamicProperty_For_SomeClass()
 {
     property = DynamicProperty.For <SomeClass>("Test", c => "value");
 }