Exemplo n.º 1
0
        public async Task Edit(EditTagVMRequest entity)
        {
            var response = await _httpService.Put <EditTagVMRequest>(url, entity);

            if (!response.Success)
            {
                throw new ApplicationException(await response.GetBody());
            }
        }
        public async Task <ActionResult> Put(EditTagVMRequest 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));
        }
Exemplo n.º 3
0
        public async Task <ApiResponse> Put(EditTagVMRequest entity)
        {
            try
            {
                var entityDB = await _entityRepository.GetByIdAsync(entity.Id);

                entityDB.Name_ar = entity.Name_ar;
                entityDB.Name_en = entity.Name_en;
                entityDB.Name_fr = entity.Name_fr;
                entityDB.Name_ru = entity.Name_ru;
                entityDB.Name_tr = entity.Name_tr;
                entityDB.Status  = entity.Status;
                await _entityRepository.UpdateAsync(entityDB);

                return(ApiResponse.Create(HttpStatusCode.OK, null));
            }
            catch (Exception)
            {
                return(ApiResponse.Create(HttpStatusCode.InternalServerError, null, "InternalServerError_Error"));
            }
        }