public void Add(EpEvent item) { using (var context = new EpEfContext()) { var dbEvent = new DbEvent { Date = item.Date, Name = item.Name }; context.Events.Add(dbEvent); context.SaveChanges(); } }
public void Add(Person person) { using (var context = new EpEfContext()) { var dbPerson = new DbPerson { FamilyName = person.FamilyName, GivenName = person.GivenName }; context.Persons.Add(dbPerson); context.SaveChanges(); } }