public async Task Edit(EditOrderVMRequest entity) { var response = await _httpService.Put <EditOrderVMRequest>(url, entity); if (!response.Success) { throw new ApplicationException(await response.GetBody()); } }
public async Task <ActionResult> Put(EditOrderVMRequest entity) { #region Start the watch var watch = new Stopwatch(); watch.Start(); #endregion var result = await _entityServices.Put(entity); #region End the watch watch.Stop(); result.Meta.TotalProcessingTime = watch.ElapsedMilliseconds; #endregion return(Ok(result)); }
public async Task <ApiResponse> Put(EditOrderVMRequest entity) { try { var entityDB = await _entityRepository.GetByIdAsync(entity.Id); if (entity.ShippingDate != 0) { entityDB.ShippingDate = DateTime.UtcNow.AddDays(entity.ShippingDate); } entityDB.Status = entity.Status; await _notificationSrevices.Post(entity.AddNotificationVM); await _entityRepository.UpdateAsync(entityDB); return(ApiResponse.Create(HttpStatusCode.OK, null)); } catch (Exception) { return(ApiResponse.Create(HttpStatusCode.InternalServerError, null, "InternalServerError_Error")); } }