What is dbcontext and dbset in entity framework?



What is dbcontext and dbset in entity framework?..

Answer / Pappu Kumar

dbContext represents the primary unit of work, encapsulating the database connection, database queries, change tracking, concurrency management, and other services. It acts as a factory for DbSet instances, where each DbSet instance represents a different type of entities managed by Entity Framework. For example, in C#, a typical dbContext might look like this: public class MyDbContext : DbContext {n public virtual DbSet<MyEntity> MyEntities {n get; set;n }n}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

What is the use of SqlCommandBuilder?

1 Answers  


feature of ADO.Net

11 Answers   Wipro,


What are the major difference between classic ADO and ADO.NET?

1 Answers  


What is difference between entity framework and ado.net?

1 Answers  


What is difference between connected and disconnected architecture in ado.net?

1 Answers  


What provider ADO.net use by default ?

5 Answers   Accenture, BirlaSoft, Wipro,


What are the different ado.net namespaces are available in .net?

1 Answers  


Explain sqlconnection object?

1 Answers  


Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?

1 Answers  


Does sqlclient and oledb class share the same functionality?

1 Answers  


What is the use of Dataview?

1 Answers  


What is aggregate root?

1 Answers  


Categories