Esempio n. 1
0
 /// <summary>
 /// Patches the <see cref="T" /> asynchronous.
 /// </summary>
 /// <param name="schemaName">The schema name.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="resource">The resource.</param>
 /// <returns>True if updated, false otherwise.</returns>
 public Task <bool> PatchAsync <T>(string schemaName, SGuid id, T resource)
 {
     using (IBaasicClient client = BaasicClientFactory.Create(Configuration))
     {
         return(client.PatchAsync <T>(client.GetApiUrl(string.Format("{{0}}/{{1}}/{0}", id), ModuleRelativePath, schemaName), resource));
     }
 }
 /// <summary>
 /// Patches the <see cref="TIn" /> asynchronous.
 /// </summary>
 /// <typeparam name="TIn">The type of the resource.</typeparam>
 /// <param name="schemaName">The schema name.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="resource">The resource.</param>
 /// <returns>True if updated, false otherwise.</returns>
 public async Task <bool> PatchAsync <TIn>(string schemaName, SGuid id, TIn resource)
 {
     try
     {
         using (IBaasicClient client = BaasicClientFactory.Create(Configuration))
         {
             return(await client.PatchAsync <TIn>(client.GetApiUrl(string.Format("{{0}}/{{1}}/{0}", id), ModuleRelativePath, schemaName), resource));
         }
     }
     catch (BaasicClientException ex)
     {
         if (ex.ErrorCode == (int)HttpStatusCode.NotFound)
         {
             return(false);
         }
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }