public IHttpActionResult Delete([FromBody] Todo pTodo) { try { TodoBLL todosBLL = new TodoBLL(); todosBLL.Delete(pTodo); return(Content(System.Net.HttpStatusCode.OK, "Todo deleted")); } catch (Exception ex) { return(Content(System.Net.HttpStatusCode.BadRequest, ex.Message)); } }
public IHttpActionResult GetAll() { try { TodoBLL todosBLL = new TodoBLL(); IEnumerable <Todo> todos = todosBLL.GetAll(); return(Content(System.Net.HttpStatusCode.OK, todos)); } catch (Exception ex) { return(Content(System.Net.HttpStatusCode.BadRequest, ex.Message)); } }
public TodoTests() { todoBLL = new TodoBLL(); }