static void Main(string[] args) { Console.WriteLine("start"); using (MedicSchedulerContext context = new MedicSchedulerContext()) { foreach (var patient in context.Patients) { Console.WriteLine($"Surname: {patient.Surname},name:{patient.Name}"); } } Console.WriteLine("end"); Console.ReadLine(); }