Exemplo n.º 1
0
        public void AddCastTestNullException()
        {
            CreateStudioDto myNullEyxeotionCast = new CreateStudioDto();

            myNullEyxeotionCast = null;
            Task.WaitAll(Assert.ThrowsExceptionAsync <ArgumentNullException>(() => _StudiosService.CreateAsync(myNullEyxeotionCast)));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateAsync(CreateStudioDto model)
        {
            try
            {
                var modelDb = await _studiosService.CreateAsync(model);

                return(Created($"studios/{modelDb.Id}", modelDb));
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
        }