public bool DeleteTask(int Id) { try { repository.DeleteTask(Id); return(true); } catch (Exception ex) { return(false); } }