예제 #1
0
        public ExpenseTrackerEFRepository(ExpenseTrackerContext ctx)
        {
            _ctx = ctx;

            // Disable lazy loading - if not, related properties are auto-loaded when
            // they are accessed for the first time, which means they'll be included when
            // we serialize (b/c the serialization process accesses those properties).
            //
            // We don't want that, so we turn it off.  We want to eagerly load them (using Include)
            // manually.

            _ctx.Configuration.LazyLoadingEnabled = false;
        }
 public ExpenseRepository(ExpenseTrackerContext context)
 {
     _context = context;
 }