public KrakenRepository(ExpenseTrackerDBContext 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; }
/// <summary> /// Initializes a new instance of the <see cref="ExpenseController"/> class. /// </summary> /// <param name="context">The db context</param> public ExpenseController(ExpenseTrackerDBContext context) : base(context, new ExpenseRepository(context)) { }
/// <summary> /// Initializes a new instance of the <see cref="ExpenseTypeController"/> class. /// </summary> /// <param name="context">The db context</param> public ExpenseTypeController(ExpenseTrackerDBContext context) : base(context) { }
/// <summary> /// Initializes a new instance of the <see cref="IncomeRepository"/> class. /// </summary> /// <param name="context">The db context</param> public IncomeRepository(ExpenseTrackerDBContext context) : base(context) { }
/// <summary> /// Initializes a new instance of the <see cref="IncomeController"/> class. /// </summary> /// <param name="context">The db context</param> public IncomeController(ExpenseTrackerDBContext context) : base(context, new IncomeRepository(context)) { this.incomeRepository = this.repository as IncomeRepository; }
/// <summary> /// Initializes a new instance of the <see cref="FrequencyController"/> class. /// </summary> /// <param name="context">The db context</param> public FrequencyController(ExpenseTrackerDBContext context) : base(context) { }