//get GoalsbyId public Goals GetGoalsById(int goalId) { try { Goals goals = db.Goals.Find(goalId); return(goals); } catch { throw; } }
//edit Goals public int EditGoals(Goals goals) { try { db.Entry(goals).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }
//Define Goals public int addGoals(Goals goals) { try { db.Goals.Add(goals); db.SaveChanges(); return(1); } catch { throw; } }
//Delete Goals public int DeleteGoals(int goalId) { try { Goals goals = db.Goals.Find(goalId); db.Goals.Remove(goals); db.SaveChanges(); return(1); } catch { throw; } }