// PATCH tables/Order/48D68C86-6EA6-4C25-AA33-223FC9A27959
 /// <summary>
 /// Patches the order dto.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="patch">The patch.</param>
 /// <returns>Task&lt;OrderDto&gt;.</returns>
 /// <exception cref="System.ArgumentException">The customer not exist.</exception>
 public Task <OrderDto> PatchOrderDto(string id, Delta <OrderDto> patch)
 {
     if (!_context.Exist <Order>(id))
     {
         throw new ArgumentException("The customer not exist.");
     }
     return(UpdateAsync(id, patch));
 }
Beispiel #2
0
        // PATCH tables/Customer/48D68C86-6EA6-4C25-AA33-223FC9A27959
        /// <summary>
        /// Patches the customer dto.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="patch">The patch.</param>
        /// <returns>Task&lt;CustomerDto&gt;.</returns>
        /// <exception cref="System.ArgumentException">
        /// The customer not exist.
        /// or
        /// Your data is not correct.
        /// </exception>
        public Task <CustomerDto> PatchCustomerDto(string id, Delta <CustomerDto> patch)
        {
            var item = patch.GetEntity();

            if (!_context.Exist <Customer>(id))
            {
                throw new ArgumentException("The customer not exist.");
            }
            if (string.IsNullOrEmpty(item.Name))
            {
                throw new ArgumentException("Your data is not correct.");
            }
            return(UpdateAsync(id, patch));
        }