async public Task UpdateNote(Note note) { byte[] byteArray = Encoding.UTF8.GetBytes(new Serializer().SerializeObject(note)); MemoryStream stream = new MemoryStream(byteArray); using (stream) { var uploadedItem = await oneDriveClient .Drive .Root .ItemWithPath(string.Format("{0}.txt", note.Id)) .Content .Request() .PutAsync<Item>(stream); } }
async public Task SaveNote(Note note) { byte[] byteArray = Encoding.UTF8.GetBytes(new Serializer().SerializeObject(note)); MemoryStream stream = new MemoryStream(byteArray); var itemSave = await oneDriveClient .Drive .Special .AppRoot .Children[string.Format("{0}.txt", note.Id)] .Content .Request() .PutAsync<Item>(stream); }