public void AddSpeaker(SpeakerDto speaker) { using (var db = new ConferenceDudeContext()) { var entry = new Speaker { Name = speaker.FirstName + " " + speaker.LastName }; db.Speakers.Add(entry); db.SaveChanges(); } }
public void UpdateSpeaker(SpeakerDto speaker) { using (var db = new ConferenceDudeContext()) { db.Entry(new Speaker { Id = speaker.Id, Name = speaker.FirstName + " " + speaker.LastName }).State = EntityState.Modified; db.SaveChanges(); } }
public void Save(SpeakerDto speaker) { }