how to create fast and much more efficient database
DESCRIPTION
how to use code first model for creating and accessing database, with WCF service in just 5 minutes.TRANSCRIPT
![Page 1: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/1.jpg)
DATABASE WITH ENTITY FRAMEWORK CODEFIRST
APPROACH WITH WCF SERVICE
![Page 2: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/2.jpg)
We will be creating project in three parts..
• Creating database in code…(EF code first)• Defining context for DB• Writing services.
All code is done in VS 2013 and follow namespace properly…….and also add reference of NuGet packafe EF 6
For 1st two create new project with class library
For services use WCF service library
![Page 3: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/3.jpg)
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.
![Page 4: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/4.jpg)
Now we define a context for accessing and interacting with databaseHere dbcontext is class defined in namespaces System.data.enitity as defined in slides for accessing databse.
![Page 5: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/5.jpg)
![Page 6: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/6.jpg)
Now we write the interfaces that will be accessible by clients ….ie functionality that can be visible on client sideTags placed over interfaces act as operation available for client to access. ie…as it is a WCF service
![Page 7: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/7.jpg)
now writing code for above functionality ieinterface and defining various logic ….// as sample given for idea
![Page 8: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/8.jpg)
![Page 9: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/9.jpg)
![Page 10: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/10.jpg)
DATABASE part all done just need to write a class for accessing service that will handle client call.
![Page 11: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/11.jpg)
![Page 12: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/12.jpg)
![Page 13: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/13.jpg)
Entity model of classes built……visual way for checking if a proper Db is generated
![Page 14: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/14.jpg)
Various DB table created after running code for first time in (localdb)\v11.0Table are created only if Db by that context is not there previously.
![Page 15: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/15.jpg)
![Page 16: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/16.jpg)
![Page 17: How to create fast and much more efficient database](https://reader033.vdocuments.mx/reader033/viewer/2022042607/559dbdc21a28ab76018b46b2/html5/thumbnails/17.jpg)
For any query and help in making different UI connection and config parts drop me a mail : [email protected]
THANK YOU