示例#1
0
        public async Task Add()
        {
            IDataPoolStorageService service = new DataPoolStorageService(new ODNSettings()
            {
                RESTAddress = "https://odn.azurewebsites.net", ApiKey = "34DA933321CD615E3748FE5A811E2F03"
            }
                                                                         );
            var result = await service.Add(new Entity.DataPoolStorage()
            {
                Data = JsonConvert.SerializeObject(new Product {
                    Name = "Mouse", Price = 10.2M
                }), DataPoolId = 1
            });

            Debug.WriteLine($"{result.Id}");
            var obj = JsonConvert.DeserializeObject <Product>(result.Data);

            Assert.True(result.Id > 0);
            Assert.True(obj.Name == "Mouse");
        }