public async Task <IActionResult> Create(Option option) { if (!ModelState.IsValid) { return(BadRequest()); } var queriedOptions = await optionsService.GetByIdAsync(option.ParentId); if (queriedOptions == null) { return(NotFound()); } await optionService.CreateAsync(option); await optionsService.AddOptionAsync(option.ParentId, option.Id); return(Ok(option)); }