LINQ專題——基本函數篇(1)

來源:互聯網
上載者:User

LINQ的函數集合我已經在C#3.0的介紹LINQ專題中提過了,這裡我們將仔細講解每一個函數的用法。基於VS2005 Beta1版本,也許在將來微軟會改變名字,大家自己注意。

今天先準備一下以後要用到的類:

class Person
...{
int _id;
int _idRole;
string _lastName;
string _firstName;
public int ID
...{
get ...{ return _id; }
set ...{ _id = value; }
}
public int IDRole
...{
get ...{ return _idRole; }
set ...{ _idRole = value; }
}
public string LastName
...{
get ...{ return _lastName; }
set ...{ _lastName = value; }
}
public string FirstName
...{
get ...{ return _firstName; }
set ...{ _firstName = value; }
}
}

class Role
...{
int _id;
string _roleDescription;
public int ID
...{
get ...{ return _id; }
set ...{ _id = value; }
}
public string RoleDescription
...{
get ...{ return _roleDescription; }
set ...{ _roleDescription = value; }
}
}

class Salary
...{
int _idPerson;
int _year;
double _salary;
public int IDPerson
...{
get ...{ return _idPerson; }
set ...{ _idPerson = value; }
}
public int Year
...{
get ...{ return _year; }
set ...{ _year = value; }
}
public double SalaryYear
...{
get ...{ return _salary; }
set ...{ _salary = value; }
}
}

 以上是三個以後常用的類,分別為Person,Role和Salary類。他們之間的關係應該一看就能看出來。我就不在說了。沒什麼複雜的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.