public async Task PostCommentsWithDataContract() { IMobileServiceClient client = GetClient(); IMobileServiceTable <DataContractBlogPost> postTable = client.GetTable <DataContractBlogPost>(); // Add a few posts and a comment Log("Adding posts"); DataContractBlogPost post = new DataContractBlogPost() { Title = "How DataContracts Work" }; await postTable.InsertAsync(post); DataContractBlogPost highlight = new DataContractBlogPost { Title = "Using the 'DataMember' attribute" }; await postTable.InsertAsync(highlight); Assert.AreEqual(2, (await postTable.Where(p => p.Id == post.Id || p.Id == highlight.Id).ToListAsync()).Count); }
public async Task PostCommentsWithDataContract() { IMobileServiceClient client = GetClient(); IMobileServiceTable<DataContractBlogPost> postTable = client.GetTable<DataContractBlogPost>(); // Add a few posts and a comment Log("Adding posts"); DataContractBlogPost post = new DataContractBlogPost() { Title = "How DataContracts Work" }; await postTable.InsertAsync(post); DataContractBlogPost highlight = new DataContractBlogPost { Title = "Using the 'DataMember' attribute" }; await postTable.InsertAsync(highlight); Assert.AreEqual(2, (await postTable.Where(p => p.Id >= post.Id).ToListAsync()).Count); }