public List <MotivationPhrase> GetAll() { MyDemoProjectContext context = new MyDemoProjectContext(); List <MotivationPhrase> phrase = context.MotivationPhrase.ToList(); return(phrase); }
public List <EmployeeData> GetAll() { MyDemoProjectContext context = new MyDemoProjectContext(); List <EmployeeData> employee = context.EmployeeData.ToList(); return(employee); }
public List <TaskData> GetAll() { MyDemoProjectContext context = new MyDemoProjectContext(); List <TaskData> tasks = context.TaskData.ToList(); return(tasks); }
public string PostCreateNew([FromBody] TaskData task) { MyDemoProjectContext context = new MyDemoProjectContext(); context.TaskData.Add(task); context.SaveChanges(); return(task.EmployeeName); }
public string DeleteSingle(string key) { MyDemoProjectContext context = new MyDemoProjectContext(); TaskData task = context.TaskData.Find(key); if (task != null) { context.TaskData.Remove(task); context.SaveChanges(); return("Task has been deleted"); } return("Task was not found and not deleted"); }
public string PutEdit(string key, [FromBody] TaskData newData) { MyDemoProjectContext context = new MyDemoProjectContext(); TaskData opentask = context.TaskData.Find(key); if (opentask != null) { //opentask.TaskTitle = newData.TaskTitle; opentask.EmployeeName = newData.EmployeeName; opentask.Status = newData.Status; context.SaveChanges(); return("OK"); } return("Not Found"); }