hii comunity please guide mw with which approch of ef i should master and which is widly used ?
Loading
hii comunity please guide mw with which approch of ef i should master and which is widly used ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prasad RaveendranPosted Nov 2, 2023, 11:43 PM
An approach known as Fluent API is used in Entity Framework. I encourage you to delve into this method. Also, have you heard of a tool called "Power Tool"? It's beneficial for Reverse Engineering. I suggest generating the database first, then employing this tool to create models and DatabaseContext classes.
Sam HobbsPosted Nov 1, 2023, 8:39 PM
Entity Framework is very useful and very worth learning. Something else important to learn is database design in general. There are many books about database design.
I think it is worthwhile to understand both approaches, database-first and code-first. It is important to understand what effect each will have.
There is also something called design-first, I think design-first is good but Microsoft has dropped support of that, I think we can find tools for doingf that if we want to
Jignesh KumarPosted Oct 30, 2023, 4:08 AM
Hi Abhishek,
Entity Framework is a popular object-relational mapping (ORM) framework in .NET used to interact with databases.
Entity Framework offers several approaches, but the two primary ones are:
Database-First Approach: In this approach, you start by designing your database schema using a tool like SQL Server Management Studio or other database design tools. Then, Entity Framework generates the model classes based on this existing database schema.
Code-First Approach: With the code-first approach, you define your model classes in code first and then generate the database from those classes. Entity Framework creates the necessary tables and relationships in the database based on the code you've written.
Which Approach to Master:
Choosing the right approach often depends on various factors such as your project requirements, team preferences, existing databases, and development workflows.
Both approaches have their merits, but the Code-First approach is more flexible and widely used. It allows for more control and customization, especially in scenarios where you're building the application from scratch or don’t have a rigidly defined database structure.
If you're starting fresh or have the flexibility to define the database structure from code, learning the Code-First approach might be more beneficial as it allows for better version control, facilitates testing, and can make the development process smoother.