Exemplo n.º 1
0
        static void Main(string[] args)
        {
            using (var db = new OrdersDbContext())
            {
                var order = new Order {
                    Description = "First Order"
                };
                db.Orders.Add(order);
                db.SaveChanges();
            }


            using (var db = new OrdersDbContext())
            {
                var orders = db.Orders.ToList();
                Console.WriteLine(orders.Count);
            }
        }
Exemplo n.º 2
0
 public OrderRepository(OrdersDbContext dbContext)
 {
     _dbContext = dbContext;
 }