예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
 }