I am new to the Entity Framework and while I have the basics down, I am stumbling over a specific syntax that I do not understand. The code works, but it is a bit of a "black box" to me and I fee a bit hampered by not understanding it.
I have a local private variable declared in my class as thus:
private clientexperienceEntities ceContext;
Farther in my code I instantiate it thus:
ceContext = new clientexperienceEntities();
This next line is the portion I am having difficulty with:
var client = ceContext.clients.First(a => a.ID == _ID);
Specifically the parameters to the First method, what exactly does a => a.ID == _ID
mean? I know it is telling the context to find the first matching record based on the primary key value contained in the _ID
value. But I don't understand where the 'a' comes from, or whatever other name I want to use, 'b' or 'cat'.
Is this syntax part of Linq? I am not even sure what exactly to search for to understand it.
As I said the statement works, and I can the manipulate the entity returned, but I just don't fully understand that parameter construct.