コード例 #1
0
        // 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);
        }
コード例 #2
0
 public ExpenseDetailController(ExpenseSystem theExpenseSystem)
 {
     _theExpenseSystem = theExpenseSystem;
 }
コード例 #3
0
 public ExpenseDetailController(ExpenseSystem expense)
 {
     _theExpenseSystem = expense;
 }