/// <summary> /// Update customer of an app by Id /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">App Name Id</param> /// <param name="customerId">Customer Id</param> /// <param name="updateCustomer">Updated customer information</param> /// <returns>ApiResponse of RestApiResultCustomer</returns> public ApiResponse <RestApiResultCustomer> UpdateCustomerByIdWithHttpInfo(string appId, int?customerId, CustomerUpdateModel updateCustomer) { // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException(400, "Missing required parameter 'appId' when calling CustomersApi->UpdateCustomerById"); } // verify the required parameter 'customerId' is set if (customerId == null) { throw new ApiException(400, "Missing required parameter 'customerId' when calling CustomersApi->UpdateCustomerById"); } // verify the required parameter 'updateCustomer' is set if (updateCustomer == null) { throw new ApiException(400, "Missing required parameter 'updateCustomer' when calling CustomersApi->UpdateCustomerById"); } var localVarPath = "/api/v1.0/{appId}/customers/{customerId}"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (appId != null) { localVarPathParams.Add("appId", this.Configuration.ApiClient.ParameterToString(appId)); // path parameter } if (customerId != null) { localVarPathParams.Add("customerId", this.Configuration.ApiClient.ParameterToString(customerId)); // path parameter } if (updateCustomer != null && updateCustomer.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(updateCustomer); // http body (model) parameter } else { localVarPostBody = updateCustomer; // byte array } // authentication (oauth2) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("UpdateCustomerById", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <RestApiResultCustomer>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (RestApiResultCustomer)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RestApiResultCustomer)))); }
/// <summary> /// Update customer of an app by Id /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">App Name Id</param> /// <param name="customerId">Customer Id</param> /// <param name="updateCustomer">Updated customer information</param> /// <returns>Task of RestApiResultCustomer</returns> public async System.Threading.Tasks.Task <RestApiResultCustomer> UpdateCustomerByIdAsync(string appId, int?customerId, CustomerUpdateModel updateCustomer) { ApiResponse <RestApiResultCustomer> localVarResponse = await UpdateCustomerByIdAsyncWithHttpInfo(appId, customerId, updateCustomer); return(localVarResponse.Data); }
//Update data public async Task <int> UpdateCustomers(CustomerUpdateModel customerUpdateModel) { return(await _customerRepository.UpdateCustomers(customerUpdateModel)); }
/// <summary> /// Update customer of an app by Id /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">App Name Id</param> /// <param name="customerId">Customer Id</param> /// <param name="updateCustomer">Updated customer information</param> /// <returns>RestApiResultCustomer</returns> public RestApiResultCustomer UpdateCustomerById(string appId, int?customerId, CustomerUpdateModel updateCustomer) { ApiResponse <RestApiResultCustomer> localVarResponse = UpdateCustomerByIdWithHttpInfo(appId, customerId, updateCustomer); return(localVarResponse.Data); }
public int Create(CustomerUpdateModel customer) { var model = ToModel(customer); return(_repository.Save(model).Id); }
public async Task UpdateAsync([FromBody] CustomerUpdateModel updateModel) { var model = updateModel.ToModel(); await _customerService.UpdateAsync(model); }
public IActionResult Update([FromBody] CustomerUpdateModel model) { return(Ok(_customerServieces.UpdateCustomer(model))); }
public Task <Customer> UpdateAsync(CustomerUpdateModel customer) { return(CustomerDataAccess.UpdateAsync(customer)); }
public static Customer ConvertToEntity(this CustomerUpdateModel updateModel) => new Customer { Name = new FullName(updateModel.FirstName, updateModel.MiddleName, updateModel.LastName) };