public async Task <IActionResult> Create(CreateActorModel model) { if (!ModelState.IsValid) { return(View(model)); } var actor = await _actorService.CreateActorAsync(model.Name, model.Born); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Create([FromBody] CreateActorDto dto) { var result = await _actorService.CreateActorAsync(dto); return(Success(result)); }