The System.Data.EntityClient namespace is a. NET Framework Data Provider for the Entity Framework. The EntityClient provider interacts with the Entity Data Model using storage-specific ado.net data provider classes and mapping meta data. EntityClient first converts an action performed on a conceptual entity to an operation performed on a physical data source. The result set returned by the physical data source is then converted to a conceptual entity.
The classes under EntityClient have several of the following:
L EntityConnection
L EntityCommand
L Entityconnectionstringbuilder
L Entityparameter
L EntityDataReader
L Entityparametercollection
L Entityproviderfactory
L Entitytransaction
From the names of the classes, we know what their role is. Here, it is no longer one by one explained. Learn them directly from the instance code.
L EntityConnection:
Instance Code 1:
string con = "name = NorthwindEntities";
using (EntityConnection econn = new EntityConnection(con))
{
string esql = "Select VALUE c from NorthwindEntities.Customers as c where c.CustomerID='ALFKI'";
econn.Open();
EntityCommand ecmd = new EntityCommand(esql , econn);
EntityDataReader ereader = ecmd.ExecuteReader(CommandBehavior.SequentialAccess);
if (ereader.Read())
{
Console.WriteLine(ereader["CustomerID"]);
}
Console.WriteLine(ecmd.ToTraceString());
}