Пример #1
0
        private void AssertHouse(DomainProperty property)
        {
            AssertPropertyObject(property, "Hourse", "AdminPersonHourse");
            var ps = DomainProperty.GetProperties(property.PropertyType).ToArray();

            AssertPropertyValue(ps[0], "Address", typeof(string));
        }
Пример #2
0
 public static IEnumerable <DomainProperty> GetProperties(Type objectType)
 {
     if (!objectType.IsDerived())
     {
         return(DomainProperty.GetProperties(objectType));
     }
     return(_getPropertiesByDerived(objectType));
 }
Пример #3
0
        private void AssertPerson(DomainProperty property)
        {
            AssertPropertyObject(property, "Person", "AdminPerson");
            var ps = DomainProperty.GetProperties(property.PropertyType).ToArray();

            AssertPropertyValue(ps[0], "Name", typeof(string));
            AssertPropertyValue(ps[1], "Sex", typeof(byte));

            AssertHouse(ps[2]);

            var son = ps[3];

            AssertPropertyObject(son, "Son", "AdminPerson");
            var sonPS = DomainProperty.GetProperties(son.PropertyType).ToArray();

            AssertPropertyValue(sonPS[0], "Name", typeof(string));
            AssertPropertyValue(sonPS[1], "Sex", typeof(byte));
            AssertHouse(sonPS[2]);
        }
Пример #4
0
        private void AssertMenu(DomainProperty property)
        {
            //menu:{person:{id:'long',name:'string,5'},name:'string,10',parent:'menu',childs:['menu']}
            AssertPropertyObject(property, "Menu", "AdminMenu");
            var ps = DomainProperty.GetProperties(property.PropertyType).ToArray();


            AssertPropertyObject(ps[0], "Person", "AdminMenuPerson");
            var person           = ps[0];
            var personProperties = DomainProperty.GetProperties(person.PropertyType).ToArray();

            AssertPropertyValue(personProperties[0], "Id", typeof(long));
            AssertPropertyValue(personProperties[1], "Name", typeof(string));


            AssertPropertyValue(ps[1], "Name", typeof(string));
            AssertPropertyObject(ps[2], "Parent", "AdminMenu");


            var childsType = TypeDefine.GetListType(property.PropertyType);

            AssertPropertyList(ps[3], "Childs", childsType);
        }