// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); //constructor... var expenseStorage = new ExpenseStorageList(); var _theExpenseSystem = new ExpenseSystem(expenseStorage); services.AddSingleton <ExpenseSystem>(_theExpenseSystem); }
public ExpenseDetailController(ExpenseSystem theExpenseSystem) { _theExpenseSystem = theExpenseSystem; }
public ExpenseDetailController(ExpenseSystem expense) { _theExpenseSystem = expense; }