Getting started with EntityFramework

EF is an ORM tool that helps to design your persistence layer quickly. Now you can ask but why ? we already had and it was doing well, but wait and think wouldn't it be great if you can think and treat your database in terms of classes and objects. where your table is a class its columns are properties and each row is an object, now as a developer, you can play with it. That is the role of any ORM and Entity framework is just an ORM that's it.

There are three different workflows of Entity Framework, Like database first, code first and model first, each workflow helps us to design our domain model. Creating a persistence framework with Ado.Net was time-consuming and hectic, we had to manage the connections, we had to write SQL Commands and Execute them on the server using command class methods like ExecuteReader(), ExecuteNonQuery() or ExecuteScalar() but with entity framework, we don't need to think about any of these things we can just focus on our code, we just play with collections and object, we fetch data from in-memory collection and add data to the in-memory collection, Entity Framework takes care of all the rest of the things like managing the connection and executing necessary T-SQL command, etc.

With Entity Framework, we can do everything that we could do on a SQL Server database like calling a Stored Procedure or Views creating tables, altering them, or executing any DML queries against SQL server.

Nowadays almost every company uses Entity Framework, so having its knowledge becomes necessary. But Don't worry we will learn each and every concept of Entity Framework in great detail with examples

Welcome to the journey of becoming EntityFramework expert,if you are a beginner and really want to be a professional, then follow the below steps:-

  • Go through each article one by one without skipping any of them.
  • Try to implement and practice what you have learnt in the article by yourself.
  • Use your imagination and thinking power and ask these questions to yourself:-
    • Why did i read this article?
    • What i learned after reading this article?
    • Should i open visual studio and try to implement something?
    • Am i getting errors?ok ,which type of error
      • Is it compilation error?
      • Is it Run time error?
      • Can i solve this myself?
      • Can my friends solve this problem?
      • Should i ask this question on Stackoverflow?