Example #1
0
 public async Task <string> Create(HallViewModel hall, IFormFile file)
 {
     if (file != null)
     {
         await _formFileToByteConverterService.ConvertAsync(file, hall);
     }
     hall.Stands = new List <StandViewModel>();
     return(await _hallsRepository.CreateAsync(hall));
 }
Example #2
0
        public async Task <IActionResult> CreateAsync(Hall hall)
        {
            try
            {
                var id = await _hallsRepository.CreateAsync(hall);

                return(Ok(id));
            }
            catch (Exception)
            {
                throw new Error(Errors.Create_error, $"Can not add record {hall}");
            }
        }