예제 #1
0
파일: Client.cs 프로젝트: mathewdenis/REST
        public async Task Run()
        {
            PersonClient personClient = new PersonClient();
            AccountClient accountClient = new AccountClient();
            UserClient userClient = new UserClient();

            
            //Test out PersonHandler (VerbHandler<T,TKey>) server side REST handler, expects XML

            await personClient.GetPerson(1);
            await personClient.GetPeople();
            await personClient.PostPerson();
            await personClient.PutPerson();
            await personClient.DeletePerson();

            //Test out AccountHandler (VerbHandler<T,TKey>) server side REST handler, expects JSON

            await accountClient.GetAccount(1);
            await accountClient.GetAccounts();
            await accountClient.PostAccount();
            await accountClient.PutAccount();
            await accountClient.DeleteAccount();


            //Test out UserHandler (DynamicRouteHandler<T,TKey>) server side REST handler, expects JSON

            await userClient.GetUser(1);
            await userClient.GetUsers();
            await userClient.PostUser();
            await userClient.PutUser();
            await userClient.DeleteUser();
        }
예제 #2
0
        public async Task Run()
        {
            PersonClient  personClient  = new PersonClient();
            AccountClient accountClient = new AccountClient();
            UserClient    userClient    = new UserClient();


            //Test out PersonHandler (VerbHandler<T,TKey>) server side REST handler, expects XML

            await personClient.GetPerson(1);

            await personClient.GetPeople();

            await personClient.PostPerson();

            await personClient.PutPerson();

            await personClient.DeletePerson();

            //Test out AccountHandler (VerbHandler<T,TKey>) server side REST handler, expects JSON

            await accountClient.GetAccount(1);

            await accountClient.GetAccounts();

            await accountClient.PostAccount();

            await accountClient.PutAccount();

            await accountClient.DeleteAccount();


            //Test out UserHandler (DynamicRouteHandler<T,TKey>) server side REST handler, expects JSON

            await userClient.GetUser(1);

            await userClient.GetUsers();

            await userClient.PostUser();

            await userClient.PutUser();

            await userClient.DeleteUser();
        }