コード例 #1
0
        public ActionResult PutSupply(string replace, [FromBody] Data.Models.Picture pic)
        {
            var found = _repository.GetSpecificMethod(replace);

            if (found != null)
            {
                found.Idea     = pic.Idea;
                found.Content1 = pic.Content1;
                found.Content2 = pic.Content2;
                _repository.PutMethod(found);
                return(NoContent());
            }
            return(NotFound());
        }
コード例 #2
0
        public ActionResult PostSupply([FromBody, Bind("Content1", "Content2", "Idea")] Data.Models.Picture pic)
        {
            var temp0 = _repository.GetMethod();

            if (temp0.Count() > 0)
            {
                int temp = _repository.GetMethod().Max <Data.Models.Picture>(e => e.Id);
                pic.Id = temp + 1;
                _repository.PostMethod(pic);
            }
            else
            {
                pic.Id = 0;
                _repository.PostMethod(pic);
            }
            return(NoContent());
        }