SlideShare a Scribd company logo
EntityFramework(EF)7
Entity Framework (EF) is a Object Relational Mapping framework from Microsoft
and is used to connect the different domains of database and object-oriented
languages.
EF7 is the next version and Microsoft has set some big goals for it's development.
These included a lightweight, extensible framework to targeting new data stores
like Azure Table Storage and Redis and new platforms like Windows Phone,
Windows Store as well as ASP.NET 5.
Entity framework (EF) 7
Non-relational
Traditional EF has been written to target relational databases and is the bread
and butter of development. However new non-relational or No-SQL data stores
are growing in popularity and their support is long overdue.
To manage this EF7 has been rewritten from the ground up to be composable.
This has meant breaking apart the existing monolithic dll's into separate and
more specialized ones.
For instance, EF6 with SQL was over 5MB. This is now down to under 1MB and
this has the potential to be even smaller if you're using NoSQL DB, as relational
features have also been separated.
Not all No-SQL Database will be supported as they may not necessary map to
EF.
New Platforms
Thanks to the developments mentioned above EF is now able to target a wider
range of data-sources including SQL Compact and SQLite, both explicitly targeted
occasionally connected applications with a smaller foot print.
This makes it ideal for Windows Phone and Store Applications. Additional EF7
will support .Net Core Dot Net Core is a major focus for Microsoft and is it's
attempt to build a lean and modular framework for targeting server and cloud
environments. As well as providing cross compatible support for Linux and Macs'.
IOC Friendly
The composable nature of EF7 brings the added benefit of Dependency injection.
DI is a pattern where the responsibility for construction of an object is taken away
from the calling object. While this may sound trivial, it brings a loose coupled,
allowing components to interchanged, without recompilation.
Firstly via code in Startup.cs .
services.AddEntityFramework().AddSqlServer()
.AddDbContext<BloggingContext>();
Or via the Config.json file.
"EntityFramework": {
"BloggingContext": {
"ConnectionString" : "Server=.SQLEXPRESS;Database=......;"}}
Addition we also gain improved Unit testing, making it possible to switch out a
production code for fakes and stubs.
Migration
Migrations require a snapshot, previously they were stored as a hash in the DB,
now they can be found in code.
[ContextType(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
public override void BuildModel(ModelBuilder builder)
{
builder.Annotation("SqlServer:ValueGeneration", "Identity");
builder.Entity("MyProject.ViewModels.Blog", b => {
b.Property<string>("BlogId")
.GenerateValueOnAdd()
.Annotation("OriginalValueIndex", 0);
b.Property<string>("BlogTitle")
.Annotation("OriginalValueIndex", 1);
b.Property<string>("BlogBlog")
.Annotation("OriginalValueIndex", 2);
Also migrations are now idempotent, which means they can be re-run multiple
times and still produce the same result.
These changes will eliminate some of obscure error, improving the reliability of
migrations and allows a snapshot to edit and recreate one from an existing
Database.
Batch Operations
One of long requested features has been batching of updates. Previously this
could be accomplished create you own batch functionality or upload via a
different method i.e. via SQL Command SQLCMD.
using(var contect = new BloggingContext())
{
var listOfBlogEntries = context.Blogs.ToList();
context.Remove(listOfBlogEntries);
context.SaveChanges();
context.Add(listOfBlogEntries);
context.SaveChanges();
}
However batch updates actually go beyond simple overloading of the basic
CRUD operations, as show above.
using(var contect = new BloggingContext())
{
var listOfBlogEntries = context.Blogs.ToList();
var oldBlog = listOfBlogEntries.FirstOrDefault();
oldBlog.Published = false;
var blog = new Blog { BlogTitle = "New Blog One"}
context.Remove(
listOfBlogEntries
.Where(b => b.PublishedDate == DateTime.Now.AddYears(2)
&& b.Published == false));
blog.Comments.Add( new Comment {
CommentBody = "Comment on the blog" });
context.Add(blog);
context.SaveChanges();
}
EF7 is smart enough to consolidate a list of disparate updates into one single
request. Which will result in a massive boost to performance.
Deprecated
As I've already mentioned some feature have been removed, these features will
continue to be available in EF6. Which Microsoft will continuously support for the
foreseeable future.
 EDMX Support
 ObjectContextAPI
 Entity SQL
 Metadata Workspace API
 Overly Complex Mappings
 MEST (Multiple Entities for Single Type) Mapping
 Automatic Migrations
Some of these feature may find their way back into EF7 at a later stage, though
third parties or re-implemented by Microsoft, however by cutting out these
complex and rarely used features, EF if now a far more focused framework.
Additionalresources
http://blogs.msdn.com/b/adonet/
https://github.com/aspnet/EntityFramework/wiki/What-is-EF7-all-about
https://entityframework.codeplex.com/
Ad

More Related Content

What's hot (20)

Setup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architectureSetup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architecture
Mindfire Solutions
 
ASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big DealASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big Deal
Jim Duffy
 
Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_
ForceBolt
 
Best PHP Frameworks
Best PHP FrameworksBest PHP Frameworks
Best PHP Frameworks
Clixlogix Technologies
 
Entity Framework Code First Migrations
Entity Framework Code First MigrationsEntity Framework Code First Migrations
Entity Framework Code First Migrations
Diluka99999
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIAS
Pamela Fox
 
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET CoreBuilding HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Filip W
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
Shiju Varghese
 
Php Framework
Php FrameworkPhp Framework
Php Framework
cncwebworld
 
Apache Flex: Overview
Apache Flex: OverviewApache Flex: Overview
Apache Flex: Overview
Tarun Telang
 
Architecting RIAs with Silverlight
Architecting RIAs with SilverlightArchitecting RIAs with Silverlight
Architecting RIAs with Silverlight
Josh Holmes
 
ColdFusion 11 New Features
ColdFusion 11 New FeaturesColdFusion 11 New Features
ColdFusion 11 New Features
Mindfire Solutions
 
Live session 2 lightning web component
Live session 2 lightning web componentLive session 2 lightning web component
Live session 2 lightning web component
SmritiSharan1
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
Component Based Development
Component Based DevelopmentComponent Based Development
Component Based Development
Ben McCormick
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
Cloud Analogy
 
C# 4.0 - Whats New
C# 4.0 - Whats NewC# 4.0 - Whats New
C# 4.0 - Whats New
Venketash (Pat) Ramadass
 
C#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentC#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course Content
SVRTechnologies
 
EF Core 1: News features and changes
EF Core 1: News features and changesEF Core 1: News features and changes
EF Core 1: News features and changes
Manfred Steyer
 
Php Frameworks
Php FrameworksPhp Frameworks
Php Frameworks
Ryan Davis
 
Setup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architectureSetup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architecture
Mindfire Solutions
 
ASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big DealASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big Deal
Jim Duffy
 
Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_
ForceBolt
 
Entity Framework Code First Migrations
Entity Framework Code First MigrationsEntity Framework Code First Migrations
Entity Framework Code First Migrations
Diluka99999
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIAS
Pamela Fox
 
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET CoreBuilding HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Filip W
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
Shiju Varghese
 
Apache Flex: Overview
Apache Flex: OverviewApache Flex: Overview
Apache Flex: Overview
Tarun Telang
 
Architecting RIAs with Silverlight
Architecting RIAs with SilverlightArchitecting RIAs with Silverlight
Architecting RIAs with Silverlight
Josh Holmes
 
Live session 2 lightning web component
Live session 2 lightning web componentLive session 2 lightning web component
Live session 2 lightning web component
SmritiSharan1
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
Component Based Development
Component Based DevelopmentComponent Based Development
Component Based Development
Ben McCormick
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
Cloud Analogy
 
C#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentC#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course Content
SVRTechnologies
 
EF Core 1: News features and changes
EF Core 1: News features and changesEF Core 1: News features and changes
EF Core 1: News features and changes
Manfred Steyer
 
Php Frameworks
Php FrameworksPhp Frameworks
Php Frameworks
Ryan Davis
 

Similar to Entity framework (EF) 7 (20)

Ef code first
Ef code firstEf code first
Ef code first
ZealousysDev
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101
Rich Helton
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
Entity Framework Interview Questions PDF By ScholarHat
Entity Framework Interview Questions PDF By ScholarHatEntity Framework Interview Questions PDF By ScholarHat
Entity Framework Interview Questions PDF By ScholarHat
Scholarhat
 
6 database
6 database 6 database
6 database
siragezeynu
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
ukdpe
 
Using entity framework core in .net
Using entity framework core in .netUsing entity framework core in .net
Using entity framework core in .net
Sophie Obomighie
 
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdfASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
State of entity framework
State of entity frameworkState of entity framework
State of entity framework
David Paquette
 
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
SeasiaInfotech2
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
Knoldus Inc.
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFramework
Akhil Mittal
 
cosmodb ppt project.pptxakfjhaasjfsdajjkfasd
cosmodb ppt project.pptxakfjhaasjfsdajjkfasdcosmodb ppt project.pptxakfjhaasjfsdajjkfasd
cosmodb ppt project.pptxakfjhaasjfsdajjkfasd
Central University of South Bihar
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdfWhy ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
SeasiaInfotech2
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
Jibran Rasheed Khan
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
Mahmoud Ouf
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
Naveen Kumar Veligeti
 
.Net Core
.Net Core.Net Core
.Net Core
Bohdan Pashkovskyi
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
Rich Helton
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101
Rich Helton
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
Entity Framework Interview Questions PDF By ScholarHat
Entity Framework Interview Questions PDF By ScholarHatEntity Framework Interview Questions PDF By ScholarHat
Entity Framework Interview Questions PDF By ScholarHat
Scholarhat
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
ukdpe
 
Using entity framework core in .net
Using entity framework core in .netUsing entity framework core in .net
Using entity framework core in .net
Sophie Obomighie
 
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdfASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
State of entity framework
State of entity frameworkState of entity framework
State of entity framework
David Paquette
 
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
SeasiaInfotech2
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
Knoldus Inc.
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFramework
Akhil Mittal
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdfWhy ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
SeasiaInfotech2
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
Jibran Rasheed Khan
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
Naveen Kumar Veligeti
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
Rich Helton
 
Ad

More from Paul Graham (8)

Publising a nuget package
Publising a nuget packagePublising a nuget package
Publising a nuget package
Paul Graham
 
EPiServer report generation
EPiServer report generationEPiServer report generation
EPiServer report generation
Paul Graham
 
A guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled JobA guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled Job
Paul Graham
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
Paul Graham
 
Adding disqus to ghost blog
Adding disqus to ghost blogAdding disqus to ghost blog
Adding disqus to ghost blog
Paul Graham
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
Paul Graham
 
C# 6.0
C# 6.0C# 6.0
C# 6.0
Paul Graham
 
Code syntax highlighting in ghost
Code syntax highlighting in ghostCode syntax highlighting in ghost
Code syntax highlighting in ghost
Paul Graham
 
Publising a nuget package
Publising a nuget packagePublising a nuget package
Publising a nuget package
Paul Graham
 
EPiServer report generation
EPiServer report generationEPiServer report generation
EPiServer report generation
Paul Graham
 
A guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled JobA guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled Job
Paul Graham
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
Paul Graham
 
Adding disqus to ghost blog
Adding disqus to ghost blogAdding disqus to ghost blog
Adding disqus to ghost blog
Paul Graham
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
Paul Graham
 
Code syntax highlighting in ghost
Code syntax highlighting in ghostCode syntax highlighting in ghost
Code syntax highlighting in ghost
Paul Graham
 
Ad

Recently uploaded (20)

Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 

Entity framework (EF) 7

  • 1. EntityFramework(EF)7 Entity Framework (EF) is a Object Relational Mapping framework from Microsoft and is used to connect the different domains of database and object-oriented languages. EF7 is the next version and Microsoft has set some big goals for it's development. These included a lightweight, extensible framework to targeting new data stores like Azure Table Storage and Redis and new platforms like Windows Phone, Windows Store as well as ASP.NET 5.
  • 3. Non-relational Traditional EF has been written to target relational databases and is the bread and butter of development. However new non-relational or No-SQL data stores are growing in popularity and their support is long overdue.
  • 4. To manage this EF7 has been rewritten from the ground up to be composable. This has meant breaking apart the existing monolithic dll's into separate and more specialized ones. For instance, EF6 with SQL was over 5MB. This is now down to under 1MB and this has the potential to be even smaller if you're using NoSQL DB, as relational features have also been separated. Not all No-SQL Database will be supported as they may not necessary map to EF.
  • 5. New Platforms Thanks to the developments mentioned above EF is now able to target a wider range of data-sources including SQL Compact and SQLite, both explicitly targeted occasionally connected applications with a smaller foot print. This makes it ideal for Windows Phone and Store Applications. Additional EF7 will support .Net Core Dot Net Core is a major focus for Microsoft and is it's attempt to build a lean and modular framework for targeting server and cloud environments. As well as providing cross compatible support for Linux and Macs'.
  • 6. IOC Friendly The composable nature of EF7 brings the added benefit of Dependency injection. DI is a pattern where the responsibility for construction of an object is taken away from the calling object. While this may sound trivial, it brings a loose coupled, allowing components to interchanged, without recompilation. Firstly via code in Startup.cs . services.AddEntityFramework().AddSqlServer() .AddDbContext<BloggingContext>(); Or via the Config.json file. "EntityFramework": { "BloggingContext": { "ConnectionString" : "Server=.SQLEXPRESS;Database=......;"}} Addition we also gain improved Unit testing, making it possible to switch out a production code for fakes and stubs.
  • 7. Migration Migrations require a snapshot, previously they were stored as a hash in the DB, now they can be found in code. [ContextType(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot { public override void BuildModel(ModelBuilder builder) { builder.Annotation("SqlServer:ValueGeneration", "Identity"); builder.Entity("MyProject.ViewModels.Blog", b => { b.Property<string>("BlogId") .GenerateValueOnAdd() .Annotation("OriginalValueIndex", 0); b.Property<string>("BlogTitle") .Annotation("OriginalValueIndex", 1); b.Property<string>("BlogBlog") .Annotation("OriginalValueIndex", 2);
  • 8. Also migrations are now idempotent, which means they can be re-run multiple times and still produce the same result. These changes will eliminate some of obscure error, improving the reliability of migrations and allows a snapshot to edit and recreate one from an existing Database.
  • 9. Batch Operations One of long requested features has been batching of updates. Previously this could be accomplished create you own batch functionality or upload via a different method i.e. via SQL Command SQLCMD. using(var contect = new BloggingContext()) { var listOfBlogEntries = context.Blogs.ToList(); context.Remove(listOfBlogEntries); context.SaveChanges(); context.Add(listOfBlogEntries); context.SaveChanges(); } However batch updates actually go beyond simple overloading of the basic CRUD operations, as show above.
  • 10. using(var contect = new BloggingContext()) { var listOfBlogEntries = context.Blogs.ToList(); var oldBlog = listOfBlogEntries.FirstOrDefault(); oldBlog.Published = false; var blog = new Blog { BlogTitle = "New Blog One"} context.Remove( listOfBlogEntries .Where(b => b.PublishedDate == DateTime.Now.AddYears(2) && b.Published == false)); blog.Comments.Add( new Comment { CommentBody = "Comment on the blog" }); context.Add(blog); context.SaveChanges(); } EF7 is smart enough to consolidate a list of disparate updates into one single request. Which will result in a massive boost to performance.
  • 11. Deprecated As I've already mentioned some feature have been removed, these features will continue to be available in EF6. Which Microsoft will continuously support for the foreseeable future.  EDMX Support  ObjectContextAPI  Entity SQL  Metadata Workspace API  Overly Complex Mappings  MEST (Multiple Entities for Single Type) Mapping  Automatic Migrations Some of these feature may find their way back into EF7 at a later stage, though third parties or re-implemented by Microsoft, however by cutting out these complex and rarely used features, EF if now a far more focused framework.