using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CodeFirst
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
CompanyContainer companyContainer = new CompanyContainer();
//this.dataGridView1.DataSource = companyContainer.Department;
//IQueryable<Department> result = (from d in companyContainer.Department orderby d.ID select d).Skip<Department>(3).Take<Department>(3);
//var result=(from d in companyContainer.Department orderby d.ID select d).AsEnumerable<Department>().Skip<Department>(3).Take<Department>(3);
var result = companyContainer.Department.Where<Department>(d=>d.ID>3);
this.dataGridView1.DataSource = result;
}
}
}