コード例 #1
0
        public async Task <IActionResult> CreateAsync(string hallId, string standId, Exhibit exhibit)
        {
            hallId.ValidateId();
            standId.ValidateId();

            try
            {
                var id = await _exhibitsRepository.CreateAsync(hallId, standId, exhibit);

                // If hall or stand not found
                if (string.IsNullOrEmpty(id))
                {
                    return(NotFound());
                }
                return(Ok(id));
            }
            catch (Exception)
            {
                throw new Error(Errors.Create_error, $"Can not create record {exhibit}");
            }
        }
コード例 #2
0
        public async Task <string> Create(string hallId, string standId, ExhibitViewModel exhibit, IEnumerable <IFormFile> files, IEnumerable <string> photoDescriptionBe, IEnumerable <string> photoDescriptionEn, IEnumerable <string> photoDescriptionRu)
        {
            exhibit = await _exhibitsService.CreateAsync(exhibit, files, photoDescriptionBe, photoDescriptionEn, photoDescriptionRu);

            return(await _exhibitsRepository.CreateAsync(hallId, standId, exhibit));
        }