public CategoryService(AccountingDataContext context) { var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context)); CategoryHandlers = new Dictionary <CategoryType, ICategoryService <Category> > { { CategoryType.Expense, expenseCategoryService }, { CategoryType.Income, incomeCategoryService }, { CategoryType.PaymentMethod, paymentMethodService } }; }
public CategoryService(AccountingDataContext context) { var context1 = context; var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context1)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context1)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context1)); _categoryServicesById = new Dictionary <int, ICategoryService> { { 1, expenseCategoryService }, { 2, incomeCategoryService }, { 3, paymentMethodService } }; }