public ActionResult <List <CheckoutRecord> > Get() { var result = _checkoutRecordRepository.GetAllCheckoutRecords().ToList(); // _books.Find(book => true).ToList(); Console.WriteLine(result); foreach (CheckoutRecord t in result) { Console.WriteLine(t.CheckoutRecordId); Console.WriteLine(t); Console.WriteLine(t.ToString()); } return(result); //return tools.ToEnumerable().ToArray();; /*var rng = new Random(); * return Enumerable.Range(1, 5).Select(index => new WeatherForecast * { * Date = DateTime.Now.AddDays(index), * TemperatureC = rng.Next(-20, 55), * Summary = Summaries[rng.Next(Summaries.Length)] * }) * .ToArray();*/ }
public IEnumerable <CheckoutRecord> getAllCheckoutRecords() { var results = _checkoutRecordRepository.GetAllCheckoutRecords(); /*var results = await _repositoryWrapper.Owner.GetAllOwnersAsync(); * * var ownerDtos = results.Select(o => new OwnerDto() * { * Id = o.Id, * Name = o.Name, * Address = o.Address, * Accounts = o.Accounts.Select(a => new AccountDto() * { * AccountType = a.AccountType, * DateCreated = a.DateCreated, * Id = a.Id * }) * }); * * return ownerDtos;*/ //return _mapper.Map<IEnumerable<OwnerDto>>(results); return(results); }