public async Task <IHttpActionResult> PutGroupGoals(int id, GroupGoals groupGoals) { if (id != groupGoals.GroupGoalId) { return(BadRequest()); } // Llamar Update de BS try { bs.Updated(groupGoals); } catch (Exception ee) { if (!GroupGoalsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetGroupGoals(int id) { GroupGoals groupGoals = bs.GetOneById(id); if (groupGoals == null) { return(NotFound()); } return(Ok(groupGoals)); }
public async Task <IHttpActionResult> PostGroupGoals(GroupGoals groupGoals) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // LLamar BS hacer insert bs.Insert(groupGoals); GroupGoals newGoal = bs.SearchByName(groupGoals.GoalName).LastOrDefault(); return(CreatedAtRoute("DefaultApi", new { id = newGoal.GroupGoalId }, newGoal)); }