public IActionResult Post(Artist a) { //if (!ModelState.IsValid) return BadRequest(); var newArtist = artistsService.AddArtist(a); //return Created("http://" + newArtist.Id, newArtist); return(CreatedAtAction("get", newArtist)); }
public ActionResult AddConfirm(NewArtistViewModel model) { if (!ModelState.IsValid) { ViewBag.Message = _helperService.ModelErrorsToString(ModelState); return(View("Add")); } var id = _artistsService.AddArtist(model); return(RedirectToAction("Details", new { Id = id })); }