public ActionResult AddClinker(CreateClinkerRequest createRequest) { if (_validator.Validate(createRequest)) { return(BadRequest(new { error = "users must have a name and password" })); } var newClinker = _clinkerRepository.AddClinker(createRequest.Name, createRequest.Password, createRequest.Age, createRequest.IsPrisoner, createRequest.ReleaseDate); return(Created($"api/clinkers/{newClinker.Id}", newClinker)); }
public IActionResult AddClinker(Clinker clinkerToAdd) { _repository.AddClinker(clinkerToAdd); return(Created($"Added Clinker {clinkerToAdd.Name}", clinkerToAdd)); }
public IActionResult AddClinker(Clinker clinkerToAdd) { _repository.AddClinker(clinkerToAdd); return(Created("", clinkerToAdd)); }