public Response <Triathlon> AddTri(Triathlon tri) { var result = new Response <Triathlon>(); result.IsSuccess = true; try { result.Data = _db.CreateTri(tri); } catch (Exception ex) { result.IsSuccess = false; result.ErrorMessage = ex.Message; } return(result); }
public Response <bool> UpdateTri(string Id, Triathlon tri) { var result = new Response <bool>(); result.IsSuccess = true; try { var objId = new ObjectId(Id); result.Data = _db.UpdateTri(objId, tri); } catch (Exception ex) { result.IsSuccess = false; result.ErrorMessage = ex.Message; } return(result); }
public Response <bool> UpdateTri(string Id, [FromBody] Triathlon tri) { var response = _repository.UpdateTri(Id, tri); return(response); }
public Response <Triathlon> AddTri([FromBody] Triathlon tri) { var response = _repository.AddTri(tri); return(response); }