Example #1
0
        public IActionResult Post([FromBody] IdentityDocument item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            item.Id = _context.IdentityDocuments.Count() + 1;
            _context.IdentityDocuments.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetIdentityDocument", new { id = item.Id }, item));
        }
Example #2
0
        public IActionResult Post([FromBody] NaturalPerson item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            item.Id = _context.NaturalPersons.Count() + 1;
            _context.NaturalPersons.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetNaturalPerson", new { id = item.Id }, item));
        }