Beispiel #1
0
        public NumTimesModel Patch(int id, [FromBody] NumTimesModel numTimes)
        {
            if (!ModelState.IsValid || id < 0 || id >= numTimesList.Count)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(new NumTimesModel());
            }

            numTimesList.Add(numTimes);
            ValidateModelSizes();
            return(numTimes);
        }
Beispiel #2
0
        public NumTimesModel Put(int id, [FromBody] NumTimesModel numTimes)
        {
            if (!ModelState.IsValid || id < 0 || id >= numTimesList.Count)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(new NumTimesModel());
            }

            numTimesList = new List <NumTimesModel>()
            {
                numTimes
            };

            return(numTimes);
        }