public async Task <IActionResult> DeletePlan(int employeeId, [FromBody] CalendarEvent @event) { db.WorkingPlans.Remove(WorkingPlanExtensions.FromCalendarEvent(@event, employeeId)); await db.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> AddPlan(int employeeId, [FromBody] CalendarEvent @event) { var newNote = WorkingPlanExtensions.FromCalendarEvent(@event, employeeId); db.WorkingPlans.Add(newNote); await db.SaveChangesAsync(); return(Ok(newNote.ToCalendarEvent())); }