Ejemplo n.º 1
0
        public static FieldMismatch[] FindClientFieldMismatches(Type clientDataType, Type serverDataType)
        {
            var clientTree = ObjectTreeTraverser.Traverse(clientDataType);
            var serverTree = ObjectTreeTraverser.Traverse(serverDataType);

            return(FindClientFieldMismatches(clientTree, serverTree, "root").ToArray());
        }
Ejemplo n.º 2
0
        public static FieldMismatch[] FindClientFieldMismatches <TClientData, TServerData>()
        {
            var clientTree = ObjectTreeTraverser.Traverse <TClientData>();
            var serverTree = ObjectTreeTraverser.Traverse <TServerData>();

            return(FindClientFieldMismatches(clientTree, serverTree, "root").ToArray());
        }
Ejemplo n.º 3
0
        public static ResponseSpecification Create <T>()
        {
            var type     = typeof(T);
            var treeNode = ObjectTreeTraverser.Traverse(type);

            return(new ResponseSpecification
            {
                Fields = SelectFields(treeNode)
            });
        }
Ejemplo n.º 4
0
        public object Format(object obj, ResponseSpecification responseSpecification)
        {
            if (obj == null)
            {
                return(null);
            }

            var treeNode = ObjectTreeTraverser.Traverse(obj.GetType());

            return(Traverse(obj, responseSpecification.Fields, treeNode));
        }
Ejemplo n.º 5
0
        public static FieldMismatch[] FindClientFieldMismatches <TServerData>(ResponseSpecification clientResponseSpecification)
        {
            var serverTree = ObjectTreeTraverser.Traverse <TServerData>();

            return(FindClientFieldMismatches(clientResponseSpecification.Fields, serverTree, "root").ToArray());
        }