示例#1
0
 public object Post(AddCalories request)
 {
     var user = Repository.GetUsers(request.UserId);
     user.Total +=request.Amount;
     Repository.UpdateUse(user);
     return new AddCaloriesResponse{NewTotal = user.Total};
 }
示例#2
0
        public object Post(AddCalories request)
        {
            var user = Repository.GetUsers(request.UserId);

            user.Total += request.Amount;
            Repository.UpdateUse(user);
            return(new AddCaloriesResponse {
                NewTotal = user.Total
            });
        }