public AddressModel GetByUser(UserModel user) { // make this generate every time so if the cache fails we notice _addresses = GetAddresses(); // yes, I know this is bad and I feel bad. But hey, it's a contrived example. var output = _addresses.FirstOrDefault(x => x.Id == user.Id); return output; }
private IList<UserModel> GetUsers() { var output = new List<UserModel>(); for (int i = 0; i < 10; i++) { var model = new UserModel { Id = i, FirstName = Faker.Name.First(), LastName = Faker.Name.Last() }; output.Add(model); } return output; }