示例#1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews();


            var tenantStorage     = new TenantStorageList();
            var rentalStorage     = new RentalStorageList();
            var assignmentStorage = new AssignStorageList();

            var rentManagement = new RentManagementSystem(rentalStorage, tenantStorage, assignmentStorage);

            services.AddSingleton <RentManagementSystem>(rentManagement);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            //build a singleton RentManagementSytem instance and inject it into any controller that needs it.

            //to override deserialization
            services.AddControllers().AddNewtonsoftJson();

            //Initilaize the list implementation for the storage systems
            var tenantStorageSystem     = new TenantStorageList();
            var rentalStorageSystem     = new RentalStorageList();
            var assignmentStorageSystem = new AssignStorageList();
            //Inject the storage system into the rentmanagment system
            var _rentManagementSystem = new RentManagementSystem(rentalStorageSystem, tenantStorageSystem, assignmentStorageSystem);

            //And then inject that rentmanagement system as a service into the web appilcation
            services.AddSingleton <RentManagementSystem>(_rentManagementSystem);
        }
示例#3
0
 public AssignmentController(RentManagementSystem rentManagementSystem)
 {
     _rentManagementSystem = rentManagementSystem;
 }
示例#4
0
 public RentalController(RentManagementSystem rentManagementSystem)
 {
     _rentManagementSystem = rentManagementSystem;
 }
示例#5
0
 public SearchController(RentManagementSystem rentManagementSystem)
 {
     //constructor
     _rentManagementSystem = rentManagementSystem;
 }
示例#6
0
        public AssignmentController(RentManagementSystem rentManagementSystem)
        {
            _rentManagementSystem = rentManagementSystem;

            //constructor........
        }
示例#7
0
 public TenantController(RentManagementSystem rentManagementSystem)
 {
     //constructor
     _rentManagementSystem = rentManagementSystem;
 }
示例#8
0
 public RentalController(RentManagementSystem rentManagementSystem)
 {
     _rentManagementSystem = rentManagementSystem;
     //constructor........
 }
 public TenantController(RentManagementSystem rentManagementSystem)
 {
     _rentManagementSystem = rentManagementSystem;
 }