
Q91
Q91 Which interface is commonly used for Dependency Injection in ASP.NET MVC?
IServiceProvider
IDependencyResolver
IDisposable
IControllerFactory
Q92
Q92 What is the main benefit of using Dependency Injection?
Faster execution
Loose coupling
Improved UI rendering
Simpler validation
Q93
Q93 Which lifecycle is associated with a Singleton service in DI?
Per request
Single instance
Per controller
Multiple instances
Q94
Q94 How do you configure Dependency Injection in ASP.NET MVC?
By defining dependencies in RouteConfig
Using an IoC container
Adding Razor syntax
Using Web.config
Q95
Q95 How do you register a service in an IoC container in ASP.NET MVC?
container.Register
container.Add
container.Map
container.Bind
Q96
Q96 How do you resolve a dependency manually in a controller?
Use ResolveDependency
Call DependencyResolver.GetService
Use GetDependency
Call Resolve
Q97
Q97 How do you inject a dependency using a constructor in MVC?
Add it to Global.asax
Define it in the controller constructor
Use a SetDependency() method
Modify the RouteConfig
Q98
Q98 A service is not being resolved by the IoC container. What could be wrong?
The service is not registered
Controller name is invalid
View is missing
Route is incorrect
Q99
Q99 A Singleton service creates multiple instances. What could be the issue?
Service scope is not Singleton
Controller is invalid
Incorrect routing
Model binding failed
Q100
Q100 An injected service throws a null reference exception. What is the issue?
Service is not registered
Service is misconfigured
Controller constructor is missing
Both A and B
Q101
Q101 What is Entity Framework (EF) in ASP.NET MVC?
A UI framework
A database ORM
A routing library
A dependency injection tool
Q102
Q102 What is the purpose of DbContext in Entity Framework?
Manage database schema
Provide a bridge between models and database
Define routing
Validate data annotations
Q103
Q103 How does Entity Framework handle lazy loading?
It loads related data automatically
It loads only requested data
It fetches all related data upfront
It does not support lazy loading
Q104
Q104 What is the difference between DbSet and DbContext in EF?
DbSet represents collections, DbContext manages database connections
Both are equivalent
DbContext defines routing, DbSet validates models
DbSet handles DI, DbContext does not
Q105
Q105 Which method is used to configure EF mappings using Fluent API?
Configure()
OnModelCreating()
Map()
CreateMapping()
Q106
Q106 How do you retrieve all records from a table using Entity Framework?
db.TableName.ToList()
db.GetAll("TableName")
db.TableName.Get()
db.FetchAll("TableName")
Q107
Q107 How do you include related entities in a query using EF?
Use Include() method
Use Join() method
Add a new DbSet
Use eager loading
Q108
Q108 How do you add a new record to a table using EF?
db.Add()
db.TableName.Add(entity)
db.SaveChanges(entity)
db.New(entity)
Q109
Q109 A query using Entity Framework returns no results. What could be wrong?
Invalid connection string
Lazy loading is disabled
DbContext is not disposed
Primary key is missing
Q110
Q110 A DbContext instance throws a "disposed" exception. What is the issue?
It is being used after being disposed
Connection string is invalid
Entity model is not defined
Primary key is missing
Q111
Q111 What is the purpose of AJAX in ASP.NET MVC?
Handle routing
Update parts of a page asynchronously
Manage database connections
Render Razor views
Q112
Q112 Which library is commonly used for AJAX in ASP.NET MVC?
jQuery
Angular
React
Knockout
Q113
Q113 What is a Partial View in ASP.NET MVC?
A fully rendered view
A reusable view component
A controller action
A database entity
Q114
Q114 How is a Partial View rendered using HTML Helpers?
@Html.RenderPartial("ViewName")
@Html.Render("ViewName")
@Html.Partial("ViewName")
@Html.View("ViewName")
Q115
Q115 What is the role of JsonResult in AJAX requests?
Return HTML
Return JSON data
Handle routing
Define models
Q116
Q116 How do you make an AJAX GET request using jQuery?
$.ajax({type: "GET"})
$.get("url")
$.ajaxGet("url")
$.fetch("url")
Q117
Q117 How do you update a DOM element with data from an AJAX call?
Use append()
Use load()
Use update()
Use replace()
Q118
Q118 How do you send data in an AJAX POST request using jQuery?
$.ajax({type: "POST", data: data})
$.post("url")
$.ajaxPost("url")
$.fetchPost("url")
Q119
Q119 An AJAX request returns a 404 error. What could be the issue?
Invalid URL
Missing controller
Incorrect data format
View not found
Q120
Q120 A Partial View does not render correctly. What could be wrong?
View is missing
Invalid route
Incorrect model passed
All of the above