Guide to Entity Framework with



Download 11,91 Mb.
Pdf ko'rish
bet26/48
Sana30.03.2022
Hajmi11,91 Mb.
#517122
TuriGuide
1   ...   22   23   24   25   26   27   28   29   ...   48
Bog'liq
Entity Framework Tutorial, Second Edition (1)

[
 18 
]
EntityClient, the gateway to entity-level queries, is the Entity Framework's 
counterpart of ADO.NET's SQL client or Oracle client that uses Entity SQL or E-SQL 
to query the conceptual model. You create a connection using the entity connection, 
execute commands through entity commands, and retrieve the result sets as entity 
data readers. The MSDN states:
 "The EntityClient provider is a data provider used by Entity Framework 
applications to access data described in a conceptual model."
Entity SQL
Entity SQL is a data store independent derivative of T-SQL that supports entity 
inheritance and 
relationships. You can use it to query data using the conceptual 
schema. You can even build your own dynamic queries. These E-SQL queries are 
internally translated to data store dependent SQL queries. This translation of the 
E-SQL queries to their data store-specific query language like T-SQL, (it doesn't 
need to be only T-SQL, however, it is the supported one), is handled by the Entity 
Framework. Entity SQL or E-SQL may not be as strongly typed as LINQ is, but you 
have the flexibility of executing dynamic queries using it, much like T-SQL.
Strongly typed data access is one of the most striking features of LINQ. 
LINQ queries are checked at compile time. This is unlike SQL queries
which are only detected at runtime.
But, why do you need Entity SQL when you have LINQ to Entities to query data 
through
your EDM? You can, using Entity SQL, compose queries that are difficult to 
determine until the time the query is executed. On a different note, Entity SQL is a 
full text-based query language that you can use in much the same way as you use
the ADO.NET data providers.
Here is an example that shows how you can use Entity SQL to insert data into
your applications:
using (EntityConnection conn = new 
EntityConnection("Name=PayrollEntities"))
{
try
{
conn.Open();
EntityCommand cmd = conn.CreateCommand();
cmd.CommandText = 
"PayrollEntities.AddNewEmployee";
cmd.CommandType = CommandType.StoredProcedure;


Chapter 1

Download 11,91 Mb.

Do'stlaringiz bilan baham:
1   ...   22   23   24   25   26   27   28   29   ...   48




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish