public HttpResponseMessage Mutant([FromBody] PersonDTO person) { if (mutantServ.IsMutant(person.dna)) { return(Request.CreateResponse(HttpStatusCode.OK, "Mutante")); } else { return(Request.CreateResponse(HttpStatusCode.Forbidden, "Humano")); } }
public async Task <IActionResult> Post([FromBody] DnaDto dna) { if (this.ModelState.IsValid) { if (await _mutantService.IsMutant(dna.dna)) { return(Ok()); } return(StatusCode(403)); } return(BadRequest(ModelState)); }