public async Task<DomainMetadataResponse> DomainMetadata (DomainMetadataRequest request)
		{
			using (HttpClient Client = new HttpClient ()) {
				DomainMetadataRequestMarshaller marshaller = new DomainMetadataRequestMarshaller ();
				marshaller.Configure (request);

				HttpResponseMessage responseMessage;

				try {
					responseMessage = await Client.SendAsync (ConfigureClient (Client, marshaller));
				} catch (WebException e) {
					throw new AWSConnectionException (e);
				}

				DomainMetadataResponseUnMarshaller unmarshaler = new DomainMetadataResponseUnMarshaller ();
				unmarshaler.Configure (responseMessage);
				return unmarshaler.UnMarshal ();
			}
		}
 public void Configure(DomainMetadataRequest request)
 {
     base.Configure (request);
 }
Пример #3
0
        public void TestSaveOrReplaceMultiple()
        {
            bool result = DAO.CreateTable ().Result;
            Assert.AreEqual (true, result);

            TestEntity entity = new TestEntity ();
            entity.Id = 0;

            TestEntity entity1 = new TestEntity ();
            entity1.Id = 1;

            bool result3 = DAO.SaveOrReplaceMultiple (new List<TestEntity> (){ entity, entity1 }).Result;
            Assert.AreEqual (true, result3);

            //Wait for save to be propagated
            System.Threading.Thread.Sleep (3000);

            DomainMetadataRequest request = new DomainMetadataRequest ("TestDao");
            DomainMetadataResponse response = Client.DomainMetadata (request).Result;
            Assert.AreEqual (HttpStatusCode.OK, response.HttpStatusCode);
            Assert.AreEqual ("2", response.DomainMetadataResult.ItemCount);
        }
Пример #4
0
        public void TestDelete()
        {
            bool result = DAO.CreateTable ().Result;
            Assert.AreEqual (true, result);

            TestEntity entity = new TestEntity ();
            entity.Id = 0;

            bool result2 = DAO.SaveOrReplace (entity).Result;
            Assert.AreEqual (true, result2);

            //Wait for save to be propagated
            System.Threading.Thread.Sleep (3000);

            DomainMetadataRequest request = new DomainMetadataRequest ("TestDao");
            DomainMetadataResponse response = Client.DomainMetadata (request).Result;
            Assert.AreEqual (HttpStatusCode.OK, response.HttpStatusCode);
            Assert.AreEqual ("1", response.DomainMetadataResult.ItemCount);

            bool result3 = DAO.Delete (entity).Result;
            Assert.AreEqual (true, result3);

            //Wait for save to be propagated
            System.Threading.Thread.Sleep (3000);

            DomainMetadataRequest request2 = new DomainMetadataRequest ("TestDao");
            DomainMetadataResponse response2 = Client.DomainMetadata (request2).Result;
            Assert.AreEqual (HttpStatusCode.OK, response2.HttpStatusCode);
            Assert.AreEqual ("0", response2.DomainMetadataResult.ItemCount);
        }