Guide to Entity Framework with



Download 11,91 Mb.
Pdf ko'rish
bet32/48
Sana30.03.2022
Hajmi11,91 Mb.
#517122
TuriGuide
1   ...   28   29   30   31   32   33   34   35   ...   48
Bog'liq
Entity Framework Tutorial, Second Edition (1)

[
 25 
]
In the model-first approach, you create your entities, relationships, and the inheritance 
hierarchies directly on the design surface of the EDM Designer in Visual Studio and 
then generate the database from the model designed. If you need additional features, 
you can use partial classes. In essence, in this approach, the model drives and defines 
the database. This is also known as the 
model-driven approach
. This approach is good 
for small projects, but with complex databases and large projects this is not a preferred 
approach as you don't have much control over the database. Also, making manual 
changes to the database schema is also not recommended.
In the database-first approach, you would create your database first and then 
generate your model using the ADO.NET EDM Designer from this database.
Support for built-in functions and UDF 
support
Entity Framework 6 provides support for you to use SQL Server functions directly in 
your queries. Here is an example:
from emp in PayrollDataContext.Employee
where new[] {"january","february","march"}.Contains(SqlFunctions.
DateName("mon
th", emp.JoiningDate))
orderby emp.EmployeeID
select new 
{
emp.EmployeeID,emp.JoiningDate
};
Support for model-defined functions
Entity Framework 6 now provides
support for model-defined functions that can be 
defined in the CSDL using eSQL. Note that model-defined functions support LINQ 
to Entities and can also be called Object methods. Here is an example:


Edm.DiffYears(Employee.BirthDate, Edm.CurrentDateTime())

.
In this section, we just gave you an introduction to the new features in Entity 
Framework 6—we will cover details of each of these features in the forthcoming 
chapters of this book.


Introducing the ADO.NET Entity Framework

Download 11,91 Mb.

Do'stlaringiz bilan baham:
1   ...   28   29   30   31   32   33   34   35   ...   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