SlideShare a Scribd company logo
1 of 17
Download to read offline
DATABASE WITH ENTITY
FRAMEWORK CODEFIRST
APPROACH WITH WCF SERVICE
We will be creating project in three parts..
• Creating database in code…(EF code first)
• Defining context for DB
• Writing services.

For 1st two create new project with class
library
For services use WCF service library

All code is done in VS 2013 and follow namespace properly…….and also add
reference of NuGet packafe EF 6
For creating database in this model we write normal
coding classes as in programs, these classes with [data
contract] attribute transfer into database table and [data
member] attribute transfer into its attribute.
Now we define a context for accessing and
interacting with database
Here dbcontext is class defined in namespaces
System.data.enitity as
defined in slides for accessing databse.
Now we write the interfaces that
will be accessible by clients ….ie
functionality that can be visible
on client side
Tags placed over interfaces act as
operation available for client to
access. ie…as it is a WCF service
now writing code for above functionality ie
interface and defining various logic ….// as
sample given for idea
DATABASE part all done just need to
write a class for accessing service that
will handle client call.
Entity model of classes built……
visual way for checking if a proper
Db is generated
Various DB table created after running code for first time
in (localdb)v11.0
Table are created only if Db by that context is not there
previously.
THANK YOU
For any query and help in making different
UI connection and config parts drop me a
mail : shivang.tyagi21@yahoo.in

More Related Content

What's hot

Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Mohamed Saleh
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9AHM Pervej Kabir
 
Entity Framework 7: New features and changes
Entity Framework 7:New features and changesEntity Framework 7:New features and changes
Entity Framework 7: New features and changesManfred Steyer
 
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...
Engineering Student MuleSoft  Meetup#2 - API Design Using Restful API Modelin...Engineering Student MuleSoft  Meetup#2 - API Design Using Restful API Modelin...
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...Jitendra Bafna
 
Public Library
Public LibraryPublic Library
Public Libraryeclumson
 
Mule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorMule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorAnkush Sharma
 
Advanced web application architecture Way2Web
Advanced web application architecture Way2WebAdvanced web application architecture Way2Web
Advanced web application architecture Way2WebMatthias Noback
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in muleSindhu VL
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overviewpradeepkothiyal
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction Miguel Sancho
 
Mule
MuleMule
MuleF K
 
Microsoft.Net Platform Basics
Microsoft.Net Platform BasicsMicrosoft.Net Platform Basics
Microsoft.Net Platform Basicsnithinmohantk
 
[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to BallerinaWSO2
 

What's hot (17)

Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)
 
Linq in asp.net
Linq in asp.netLinq in asp.net
Linq in asp.net
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
 
Entity Framework 7: New features and changes
Entity Framework 7:New features and changesEntity Framework 7:New features and changes
Entity Framework 7: New features and changes
 
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...
Engineering Student MuleSoft  Meetup#2 - API Design Using Restful API Modelin...Engineering Student MuleSoft  Meetup#2 - API Design Using Restful API Modelin...
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...
 
Public Library
Public LibraryPublic Library
Public Library
 
Mule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorMule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 Connector
 
Advanced web application architecture Way2Web
Advanced web application architecture Way2WebAdvanced web application architecture Way2Web
Advanced web application architecture Way2Web
 
Mule salesforce
Mule  salesforceMule  salesforce
Mule salesforce
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overview
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction
 
Mule
MuleMule
Mule
 
Www(alyssa) (2)
Www(alyssa) (2)Www(alyssa) (2)
Www(alyssa) (2)
 
Microsoft.Net Platform Basics
Microsoft.Net Platform BasicsMicrosoft.Net Platform Basics
Microsoft.Net Platform Basics
 
[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina
 

Similar to How to create fast and much more efficient database

MVC Application using EntityFramework Code-First approach Part4
MVC Application using EntityFramework Code-First approach Part4MVC Application using EntityFramework Code-First approach Part4
MVC Application using EntityFramework Code-First approach Part4Akhil Mittal
 
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 EntityFrameworkAkhil Mittal
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Rich Helton
 
Web services
Web servicesWeb services
Web servicesaspnet123
 
3 tier architecture in asp.net
3 tier architecture in asp.net3 tier architecture in asp.net
3 tier architecture in asp.netRavi Bansal
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17aminmesbahi
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net FundamentalsLiquidHub
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Servicessusere19c741
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf serviceBinu Bhasuran
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbaivibrantuser
 
.Net framework
.Net framework.Net framework
.Net frameworkRaghu nath
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET BasicKALIDHASANR
 
Dev buchan leveraging
Dev buchan leveragingDev buchan leveraging
Dev buchan leveragingBill Buchan
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101Rich Helton
 

Similar to How to create fast and much more efficient database (20)

MVC Application using EntityFramework Code-First approach Part4
MVC Application using EntityFramework Code-First approach Part4MVC Application using EntityFramework Code-First approach Part4
MVC Application using EntityFramework Code-First approach Part4
 
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
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 
Web services
Web servicesWeb services
Web services
 
Ef code first
Ef code firstEf code first
Ef code first
 
3 tier architecture in asp.net
3 tier architecture in asp.net3 tier architecture in asp.net
3 tier architecture in asp.net
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
 
Salesforce
SalesforceSalesforce
Salesforce
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbai
 
.Net framework
.Net framework.Net framework
.Net framework
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
 
Dev buchan leveraging
Dev buchan leveragingDev buchan leveraging
Dev buchan leveraging
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101
 
Beginners introduction to asp.net
Beginners introduction to asp.netBeginners introduction to asp.net
Beginners introduction to asp.net
 

Recently uploaded

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

How to create fast and much more efficient database

  • 1. DATABASE WITH ENTITY FRAMEWORK CODEFIRST APPROACH WITH WCF SERVICE
  • 2. We will be creating project in three parts.. • Creating database in code…(EF code first) • Defining context for DB • Writing services. For 1st two create new project with class library For services use WCF service library All code is done in VS 2013 and follow namespace properly…….and also add reference of NuGet packafe EF 6
  • 3. For creating database in this model we write normal coding classes as in programs, these classes with [data contract] attribute transfer into database table and [data member] attribute transfer into its attribute.
  • 4. Now we define a context for accessing and interacting with database Here dbcontext is class defined in namespaces System.data.enitity as defined in slides for accessing databse.
  • 5.
  • 6. Now we write the interfaces that will be accessible by clients ….ie functionality that can be visible on client side Tags placed over interfaces act as operation available for client to access. ie…as it is a WCF service
  • 7. now writing code for above functionality ie interface and defining various logic ….// as sample given for idea
  • 8.
  • 9.
  • 10. DATABASE part all done just need to write a class for accessing service that will handle client call.
  • 11.
  • 12.
  • 13. Entity model of classes built…… visual way for checking if a proper Db is generated
  • 14. Various DB table created after running code for first time in (localdb)v11.0 Table are created only if Db by that context is not there previously.
  • 15.
  • 16.
  • 17. THANK YOU For any query and help in making different UI connection and config parts drop me a mail : shivang.tyagi21@yahoo.in