ASP .NET Entity Framework 6.0 and Entity Framework Core

  1. OnModelCreating(...) (def'n)
    This method is called when the model for a derived context has been initialized, but before the model has been locked down and used to initialize the context.
  2. OnModelCreating(...) (additional facts)
    The default implementation of this method does nothing, but it can be overridden in a derived class such that the model can be further configured before it is locked down.
  3. Fluent API (def'n)
    When working with Entity Framework Code First the default behavior is to map your POCO classes to tables using a set of conventions baked into EF. Sometimes, however, you cannot or do not want to follow those conventions and need to map entities to something other than what the conventions dictate...the developer can use this.
  4. What Annotations or EF's fluent API are used for(?). (short answer)
    The two main ways you can configure EF to use something other than conventions.
  5. Code-First approach(def'n)
    With this approach, you can focus on the domain design and start creating classes as per your domain requirement rather than design your database first and then create the classes which match your database design.
  6. Data Annotations (def'n)
    Attributes, which you can apply to your domain classes and properties.These attributes override default Code-First conventions. System.ComponentModel.DataAnnotations includes attributes that impacts on nullability or size of the column.
  7. [Key] annotation (def'n)
    This data attribute sets the primary key for the Model it is contained in.
  8. Default Code-First convention {Class Name} + "Id" (def'n)
    Creates a primary key column for a property...default property.
  9. DbContext (def'n)
    This is the primary class that is responsible for interacting with data as objects.
  10. DbContext is responsible for the following activities (list)
    • EntitySet
    • Querying
    • Change Tracking
    • Persisting Data
    • Caching
    • Manage Relationship
    • Object Materialization
  11. EntitySet (def'n)
    An activity that DbContext handles; DbContext contains entity set (DbSet<TEntity>) for all the entities which is mapped to DB tables.
  12. Querying (DbContext activity) (def'n)
    DbContext converts LINQ-to-Entities queries to SQL query and sends it to the database.
  13. Change Tracking (DbContext activity/responsibility) (def'n)
    It keeps track of changes that occurred in the entities after it has been querying from the database.
  14. Persisting Data (DbContext activity/responsibility) (def'n)
    In this activity, DbContext performs the Insert, Update and Delete operations to the database, based on what the entity states.
  15. Caching (DbContext activity/responsibility) (def'n)
    In this activity, the DbContext does first level caching by default. It stores the entities which have been retrieved during the life time of a context class.
  16. Manage Relationship (DbContext activity/responsibility) (def'n)
    In this activity, DbContext also manages relationship using CSDL, MSL and SSDL in DB-First or Model-First approach or using fluent API in Code-First approach.
  17. Object Materialization (DbContext activity/responsibility) (def'n)
    DbContext converts raw table data into entity objects
  18. Entity Framework (def'n)
    An Object/Relational Mapping (O/RM) framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database.
  19. Object/Relational Mapping (O/RM) (def'n)
    A programming technique for converting data between incompatible type systems using object-oriented programming languages; in effect, a "virtual object database" that can be used from within the programming language.
  20. Name the three different development approaches used in the entity framework.(list)
    • Code First
    • Model First
    • Database first
  21. Model First approach (def'n)
    In this approach the developer creates Entities, relationships, and inheritance hierarchies directly on the design surface of EDMX and then generate database from the model.
  22. Code First approach (def'n)
    In this approach, the developer avoids working with visual model designer (EDMX) completely. The developer writes her POCO classes first and then creates database from these POCO classes.
Author
geschw66
ID
336378
Card Set
ASP .NET Entity Framework 6.0 and Entity Framework Core
Description
Definition of terms and short answer questions for the .NET Entity Framework
Updated