Esempio n. 1
0
 /// <summary>
 /// Asynchronously insert the <see cref="FileEntry" /> into the system.
 /// </summary>
 /// <param name="fileName">The file name.</param>
 /// <param name="file">The file.</param>
 public virtual Task <FileEntry> InsertAsync(string fileName, Stream file)
 {
     using (IBaasicClient client = BaasicClientFactory.Create(Configuration))
     {
         UrlBuilder uriBuilder = new UrlBuilder(client.GetApiUrl(String.Format("{0}/{1}", ModuleRelativePath, fileName)));
         return(client.PostFileAsync <FileEntry>(uriBuilder.ToString(), file, fileName));
     }
 }
 /// <summary>
 /// Asynchronously insert the <see cref="PageFile" /> into the system.
 /// </summary>
 /// <param name="pageId">Resource instance.</param>
 /// <returns>Newly created <see cref="PageFile" /> .</returns>
 public virtual Task <PageFile> InsertAsync(string fileName, Stream file, SGuid pageId)
 {
     using (IBaasicClient client = BaasicClientFactory.Create(Configuration))
     {
         UrlBuilder uriBuilder = new UrlBuilder(client.GetApiUrl(String.Format("{0}/{1}", ModuleRelativePath, fileName)));
         InitializeQueryStringPair(uriBuilder, "pageId", pageId);
         return(client.PostFileAsync <PageFile>(uriBuilder.ToString(), file, fileName));
     }
 }