예제 #1
0
        public GymWorkOutServiceResponse Create(GymWorkOut newWorkOut)
        {
            var result = new GymWorkOutServiceResponse();

            try
            {
                // This operation returns a boolean, not sure how to leverage it.
                _repo.Insert(newWorkOut);
                result.ServiceResponseCode = GymWorkOutServiceResponseCodes.CreateSuccess;
                result.ListOfWorkouts.Add(newWorkOut);
            }
            catch (Exception e)
            {
                result.Exception = e;
                result.ServiceResponseCode = GymWorkOutServiceResponseCodes.CreateFail;
            }

            return result;
        }
예제 #2
0
 public GymWorkOutServiceResponse PostASet(GymWorkOut newSet)
 {
     return _workoutService.Create(newSet);
 }