public ActionResult PostIdea([FromBody, Bind("Id", "Ideaname", "Formating", "Username")] Data.Models.Ideas idea) { //TODO: Replaces values, if count < highest value. //TODO: Or just implement Identity! int temp = _repository.GetMethod().Max <Data.Models.Ideas>(e => e.Id); idea.Id = temp + 1; _repository.PostMethod(idea); return(NoContent()); }
public ActionResult PutIdea(string replace, [FromBody] Data.Models.Ideas idea) { var found = _repository.GetSpecificMethod(replace); if (found != null) { found.Ideaname = idea.Ideaname; found.Formating = idea.Formating; found.Username = idea.Username; _repository.PutMethod(found); return(NoContent()); } return(NotFound()); }