public IActionResult Post(Person person) { var result = db.People.Add(person); db.SaveChanges(); return(Ok("Added to db")); }
public void SaveItem(Person obj) { using (var PeopleDb = new PeopleDb()) { PeopleDb.Person.Add(obj); PeopleDb.SaveChanges(); } }
public virtual void SaveItem(T obj) { using (PeopleDb db = new PeopleDb()) { db.Set <T>().Add(obj); db.SaveChanges(); } }