Beispiel #1
0
        public List <Product> getAll()
        {
            List <Product> products = Database.Products.ToList();

            foreach (Product product in products)
            {
                Database.Entry(product).Collection(p => p.Authors).Load();
                Database.Entry(product).Reference(p => p.Publisher).Load();
            }

            return(products);
        }
        public List <Author> getAll()
        {
            List <Author> authors = Database.Authors.ToList();

            foreach (Author author in authors)
            {
                Database.Entry(author).Collection(a => a.Products).Load();
                Database.Entry(author).Reference(a => a.City).Load();
                Database.Entry(author).Reference(a => a.Country).Load();
            }

            return(authors);
        }