Exemple #1
0
        public IHttpActionResult Put(Test test)
        {
            if (test == null)
            {
                return BadRequest("Argument Null");
            }
            var existing = _Db.FirstOrDefault(c => c.Id == test.Id);

            if (existing == null)
            {
                return NotFound();
            }

            existing.Content = test.Content;
            return Ok();
        }
Exemple #2
0
        public IHttpActionResult Post(Test test)
        {
            if (test == null)
            {
                return BadRequest("Argument Null");
            }
            var companyExists = _Db.Any(c => c.Id == test.Id);

            if (companyExists)
            {
                return BadRequest("Exists");
            }

            _Db.Add(test);
            return Ok();
        }