public void AddCastTestNullException() { CreateStudioDto myNullEyxeotionCast = new CreateStudioDto(); myNullEyxeotionCast = null; Task.WaitAll(Assert.ThrowsExceptionAsync <ArgumentNullException>(() => _StudiosService.CreateAsync(myNullEyxeotionCast))); }
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)); } }