public void Post(string times) { int currNum = Convert.ToInt32(times); using (var db = new GoalSetterContext()) { // For now, pull them and update them all, but eventually we will switch to per unit. var allnums = db.Set <GoalHabit>(); foreach (var row in allnums) { row.numberTimes = currNum; } db.SaveChanges(); } }
public void Post(string current) { int currNum = Convert.ToInt32(current); using (var db = new GoalSetterContext()) { var allnums = db.Set <GoalNumber>(); foreach (var row in allnums) { row.current = currNum; } db.SaveChanges(); } }