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()); }
public void Add(OwnerData entity) { _ownerContext.Owners.Add(entity); _ownerContext.SaveChanges(); }