Exemple #1
0
        public ActionResult _UrunDondur()
        {
            NORTHWND       db        = new NORTHWND();
            List <Product> ilkOnUrun = db.Products.Take(10).ToList();

            return(PartialView(ilkOnUrun));
        }
        public static void OrdersPerEmployee()
        {
            var db       = new NORTHWND();
            var employee = db.Employees;

            foreach (var item in employee)
            {
                Console.WriteLine(item.FirstName + " " + item.LastName + " " + item.Orders.Count());
            }
        }
        public static void CustomersWithNamesLongerThan25Characters()
        {
            var db        = new NORTHWND();
            var customers = db.Customers.Where(s => s.CompanyName.Length > 25);

            foreach (var item in customers)
            {
                Console.WriteLine(item.CompanyName);
            }
        }
Exemple #4
0
        public ActionResult Index()
        {
            NORTHWND        db       = new NORTHWND();
            List <Category> katList  = db.Categories.ToList();
            List <Product>  urunList = db.Products.Take(30).ToList(); // 30 tanesini alarak listeler.
            IndexViewModel  vm       = new IndexViewModel();

            vm.kategorilerim = katList;
            vm.urunlerim     = urunList;
            return(View(vm));
        }