public IHttpActionResult Delete(int id) { ProjectBAL obj = new ProjectBAL(); obj.DeleteTask(id); return(Ok("Record is deleted")); }
public void DeleteTask() { ProjectBAL obj = new ProjectBAL(); List <tblTask> Ts = obj.GetTask(); tblTask Taskgetbyid = obj.GetTaskbyId(Ts[0].TaskId); int count1 = obj.GetTask().Count(); //dynamic testtask = new (Task) list<Task>; //Task T = (new Task { TaskId = 1015, ParentName = "ParentTaskstest", TaskName = "Testtaskname", Priority = 15, SDate = DateTime.Now, EDate = DateTime.Now }); obj.DeleteTask(Taskgetbyid.TaskId); int count2 = obj.GetTask().Count(); Assert.AreEqual(count2, count1 - 1); }