I have started learning MVC, some tutorials use entity framework with it, another not, can you make some points on MVC logic and give a simple example for developing MVC app with connect to sqlserver
Loading
I have started learning MVC, some tutorials use entity framework with it, another not, can you make some points on MVC logic and give a simple example for developing MVC app with connect to sqlserver
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question.
Tuhin PaulPosted Apr 9, 2026, 9:36 AM
Learning Model-View-Controller (MVC) is a significant milestone in software architecture. To clarify your confusion about Entity Framework (EF): EF is not MVC. MVC is a design pattern for the UI, while EF is a tool for data access.
Darshan AdakanePosted Mar 29, 2026, 5:47 AM
Hello Suzan
MVC (Model-View-Controller) is a design pattern that separates an application into three parts.
Model ? Represents data and business logic (e.g., classes + DB interaction)
View ? UI layer (Razor .cshtml) used to display data
Controller ? Handles HTTP requests, interacts with Model, and returns View
Request Flow
User ->Controller -> Model -> Database->
View -> User
Entity Framework vs Without EF
With EF Core (Recommended)
ORM (Object Relational Mapper)
No need to write SQL manually
Faster development, cleaner code
Without EF (ADO.NET)
Manual SQL queries
More control but more boilerplate code
Simple MVC + SQL Server Example (EF Core)
Model
DbContext
Controller
Key Points
MVC ensures separation of concerns
Controllers should be lightweight
EF Core simplifies DB operations
Use Dependency Injection for DbContext
Use MVC + EF Core for most applications to keep code clean, maintainable, and scalable, while ADO.NET is useful when fine-grained SQL control is required.
Hope this answer helps. If yes, please mark as accepted answer.