public async Task <IActionResult> CreateBandAsync([FromBody] CreateBandViewModel createBandViewModel) { var createBandDTO = _mapper.Map <CreateBandDTO>(createBandViewModel); var bandDTO = await _bandService.CreateBandAsync(createBandDTO); var bandViewModel = _mapper.Map <BandViewModel>(bandDTO); return(Ok(bandViewModel)); }
public async Task <IActionResult> Create(CreateBandViewModel bandViewModel) { if (!this.ModelState.IsValid) { return(this.View(bandViewModel)); } await this.adminBandService.CreateBand(bandViewModel.Name, bandViewModel.Genre); return(this.Redirect("/")); }