public List <CodeDemo> ListAllDemos() { using (var context = new DemoLibraryContext()) { return(context.CodeDemos.ToList()); } }
public void AddDemo(CodeDemo info) { using (var context = new DemoLibraryContext()) { context.CodeDemos.Add(info); context.SaveChanges(); } }