public ActionResult <Owner> PostOwnerItem(Owner owner)
        {
            if (ModelState.IsValid)
            {
                owner.createdAt = DateTime.UtcNow;
                _context.OwnerItems.Add(owner);
                _context.SaveChanges();

                return(CreatedAtAction("GetOwnerItem", new Owner {
                    id = owner.id
                }, owner));
            }
            return(BadRequest());
        }
Ejemplo n.º 2
0
 public void Add(OwnerData entity)
 {
     _ownerContext.Owners.Add(entity);
     _ownerContext.SaveChanges();
 }