static List <Student> Read() { using (var context = new EFDemoContext()) { var std = context.Students.Where(x => x.Name == "Isco").ToList(); Console.WriteLine(std.Select(x => x.Name).FirstOrDefault()); return(std); } }
void Insert() { using (var context = new EFDemoContext()) { var std = new Student() { Name = "Isco" }; context.Students.Add(std); context.SaveChanges(); } }