Example #1
0
        public ActionResult PutImage(string replace, [FromBody] Data.Models.Images image)
        {
            var found = _repository.GetSpecificMethod(replace);

            if (found != null)
            {
                found.Idea           = image.Idea;
                found.Representation = image.Representation;
                found.PaidTo         = image.PaidTo;
                found.TaskDone       = image.TaskDone;
                _repository.PutMethod(found);
                return(NoContent());
            }
            return(NotFound());
        }
Example #2
0
        public ActionResult PostImage(string cost, [FromBody] Data.Models.Images image)
        {
            image.Representation = Convert.ToInt32(cost);
            var temp0 = _repository.GetMethod();

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