Ejemplo n.º 1
0
        private static void TableContext()
        {
            BetADOEntities context = new BetADOEntities();
            List <Student> list    = context.Students.ToList();

            foreach (Student item in list)
            {
                Console.WriteLine($"{item.Id}, {item.FirstName}, {item.LastName}, {item.TimeStamp} ");
            }
        }
Ejemplo n.º 2
0
        private static async Task AddingIntoTable()
        {
            BetADOEntities context = new BetADOEntities();

            context.Students.Add(new Student {
                FirstName = "Poghas", LastName = "Petros"
            });
            try
            {
                await context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.InnerException.Message);
            }
        }