I have already mentioned the function set of LINQ in section C #3.0. Here we will explain the usage of each function in detail. Based on vs2005 beta1, Microsoft may change its name in the future.
Prepare the classes that will be used later today:
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 ;}
}
}
The preceding three frequently used classes are person, role, and salary. The relationship between them can be seen at a glance. I will not talk about it anymore. Nothing complicated.