//--------------CONSTRUCTOR-------------------// public RentManagementSystem( IStoreRentals rentalStorageArg, IStoreTenants tenantsStorageArg, IStoreAssignmentList assignStorageArg) { _tenantStorageList = tenantsStorageArg; //<= on doing the dependency injection //list of units of apartment _rentalStorageList = rentalStorageArg; //list of assignments _assignStorageList = assignStorageArg; //creating the tenant(TENANTS OBJECTS) Tenant tenant1 = new Tenant(Guid.NewGuid(), "Jay", "Bhai", "01-4100 Rae Street", "S4S3A0", "Regina", "Driver's License", 900, false); Tenant tenant2 = new Tenant(Guid.NewGuid(), "Jayshree", "Ben", "02-4100 Rae Street", "S4S3A0", "Regina", "Driver's License", 900, false); // Tenant tenant3 = // new Tenant(Guid.NewGuid(), "Jayesh", "Kumar", "03-4100 Rae Street", "S4S3A0", "Regina", "Driver's License", 900, false); // Tenant tenant4 = // new Tenant(Guid.NewGuid(), "Jaya", "Kumari", "04-4100 Rae Street", "S4S3A0", "Regina", "Driver's License", 900, false); //creating the rental apartment objects Rental unit1 = new Rental(4100, 01, 2, 900, false); Rental unit2 = new Rental(4100, 02, 2, 900, false); Rental unit3 = new Rental(4100, 03, 2, 900, false); Rental unit4 = new Rental(4100, 04, 2, 900, false); //adding the tenants in the tenant list _tenantStorageList.Create(tenant1); _tenantStorageList.Create(tenant2); // _tenantStorageList.Create(tenant3); // _tenantStorageList.Create(tenant4); //adding the apartments in the apartment lists _rentalStorageList.Create(unit1); _rentalStorageList.Create(unit2); _rentalStorageList.Create(unit3); _rentalStorageList.Create(unit4); }
//----------METHODS-------------// //method to add a tenant //changes for webapi public Tenant AddTenant(Tenant tenant) { _tenantStorageList.Create(tenant); return(tenant); }