Exemplo n.º 1
0
        public async Task <IActionResult> UpdateAsync(string hallId, string standId, Exhibit exhibitIn)
        {
            exhibitIn.Id.ValidateId();
            hallId.ValidateId();
            standId.ValidateId();

            var exhibit = await _exhibitsRepository.GetAsync(hallId, standId, exhibitIn.Id);

            if (exhibit == null)
            {
                return(NotFound());
            }

            try
            {
                await _exhibitsRepository.UpdateAsync(hallId, standId, exhibitIn.Id, exhibitIn);
            }
            catch (Exception)
            {
                throw new Error(Errors.Update_error, $"Can not update record {exhibit}");
            }
            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task EditArticle(string hallId, string standId, ExhibitViewModel exhibit, IEnumerable <IFormFile> files, IEnumerable <string> ids)
        {
            exhibit = await _exhibitsService.EditArticleAsync(hallId, standId, exhibit, files, ids);

            await _exhibitsRepository.UpdateAsync(hallId, standId, exhibit.Id, exhibit);
        }