Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public Response <bool> UpdateTri(string Id, [FromBody] Triathlon tri)
        {
            var response = _repository.UpdateTri(Id, tri);

            return(response);
        }
Beispiel #4
0
        public Response <Triathlon> AddTri([FromBody] Triathlon tri)
        {
            var response = _repository.AddTri(tri);

            return(response);
        }