public ModelToModel GetAll() { ModelToModel mm; mm = new ModelToModel(); mm.w1Payments = new List<W1Payment>(); using (BookMarketDbContext db = new BookMarketDbContext()) { foreach (W1Payment entry in db.GetAllW1Payments()) { mm.w1Payments.Add(entry); } } return mm; }