Exemple #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());
        }
Exemple #2
0
        public static FieldMismatch[] FindClientFieldMismatches <TClientData, TServerData>()
        {
            var clientTree = ObjectTreeTraverser.Traverse <TClientData>();
            var serverTree = ObjectTreeTraverser.Traverse <TServerData>();

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

            return(new ResponseSpecification
            {
                Fields = SelectFields(treeNode)
            });
        }
Exemple #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));
        }
Exemple #5
0
        public static FieldMismatch[] FindClientFieldMismatches <TServerData>(ResponseSpecification clientResponseSpecification)
        {
            var serverTree = ObjectTreeTraverser.Traverse <TServerData>();

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