public async Task <string> Create(string hallId, StandViewModel stand, IFormFile file)
 {
     if (file != null)
     {
         await _formFileToByteConverterService.ConvertAsync(file, stand);
     }
     stand.Exhibits = new List <ExhibitViewModel>();
     return(await _standsRepository.CreateAsync(hallId, stand));
 }
Exemple #2
0
        public async Task <IActionResult> CreateAsync(string hallId, Stand stand)
        {
            try
            {
                hallId.ValidateId();
                var id = await _standsRepository.CreateAsync(hallId, stand);

                // If hall not found
                if (string.IsNullOrEmpty(id))
                {
                    return(NotFound());
                }
                return(Ok(id));
            }
            catch (Exception)
            {
                throw new Error(Errors.Create_error, $"Can not add record {stand}");
            }
        }