public IActionResult Post(Person person)
        {
            var result = db.People.Add(person);

            db.SaveChanges();
            return(Ok("Added to db"));
        }
Exemple #2
0
 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();
     }
 }