public IActionResult UpdateSchedule(string id, [FromBody] Sched2 Sched) { Sched.ScheduleId = id; _context.Sched2.Update(Sched); _context.SaveChanges(); return(Ok(Sched)); }
public IActionResult AddSchedule(Sched2 sched, [FromBody] Sched2 scheduleTime) { sched.ScheduleId = Guid.NewGuid().ToString(); _context.Sched2.Add(scheduleTime); _context.SaveChanges(); return(Ok("ok")); }
public IActionResult UpdateTime(string id, Sched2 _sched, [FromBody] Sched2 Sched) { Sched.ScheduleId = id; _context.Sched2.Attach(Sched); _context.Entry(Sched).Property(x => x.Time).IsModified = true; _context.SaveChanges(); return(Ok("time set")); }