public void OnPost() { RenterRepository renterRepository = new RenterRepository(); Message = renterRepository.InsertRenter(Renter); Renters = renterRepository.GetRenters(); }
public RentersModel() { RenterRepository renterRepository = new RenterRepository(); RentalRepository rentalRepository = new RentalRepository(); Renters = renterRepository.GetRenters(); Rentals = rentalRepository.GetAllRentals(); foreach (Rental rental in Rentals) { rental.Renter.Rentals = rentalRepository.GetRentalsFor(rental.Renter.Id); } foreach (Renter renter in Renters) { renter.Rentals = rentalRepository.GetRentalsFor(renter.Id); } }
public RentersModel() { RenterRepository renterRepository = new RenterRepository(); Renters = renterRepository.GetRenters(); List <RenterLevel> RenterLevelList = new List <RenterLevel>() { RenterLevel.Starter, RenterLevel.Normal, RenterLevel.TopRenter }; RenterLevels = new List <Renter>(); foreach (RenterLevel renterLevel in RenterLevelList) { RenterLevels.Add(new Renter() { RenterLevel = renterLevel }); } Heading = "Oversigt over lånere"; }
public RentersModel() { Renters = RenterRepository.GetRenters(); }