1. Floating Topic
  2. Object Context
    1. Entity State Enumeration
      1. Added (After Save = Unchanged))
      2. Deleted (After Save = Detached)
      3. Modified (After Save = Unchanged)
      4. Detached (After Save = Added)
      5. Unchanged
  3. Object Context Life Cycle
    1. Memory Usage (Can be grow better to share)
    2. Dispose (Using Block is a good approach since it implemented IDisposable)
    3. Cost of construction (Too Low no worries of considering)
    4. Thread Safety (Never share object context)
    5. Stateless (Use using block approach)
  4. Transactions
  5. Concurrency
  6. Self-Tracking Entity
    1. Tracking Methods
      1. aaaaazz
        1. Support WCF (automatically deserialized)
      2. StopTracking Method
      3. MarkAs Method
      4. MarkAsAdded Method
      5. MarkAsModified Method
      6. MarkAsUnchanged Method
      7. AcceptChanges Method
      8. Subtopic 10
      9. MarkAsDeleted Method
    2. Cant use proxy types because it is not use tracking details and need to reference domain dll directly
    3. ObjectContext needs to use Using Block
  7. Data Services
  8. Query
    1. Linq to Entities
      1. from, where, select
        1. SELECT value c FROM Contacts AS c
    2. EntitySQL
      1. Using SQL in Entity SQL
    3. Object Queries using Linq
    4. Reading Query Plan
  9. POCO
    1. SaveChanges method Calls DetectChanges that help to identify changes
    2. Properies should be virtual for Lazy Loading that uses Dynamic Proxies
    3. Dynamic Proxies
      1. Properties should be virtual
      2. Runtime inherit POCO class and create dynamic proxy that gives the functionality of EntityObject
      3. Provide Change Notification and Lazy Loading
  10. WCF
    1. Lazy Load = false for heavy Load on serializing
    2. Exposing Data as a Web Service
      1. Http Post - Insert
      2. Htttp Get - retrieve
      3. HttpDelete - Delete
      4. Http Put - update
    3. Short Lived ObjectContext
    4. Uses OData (Protocol Open Data Protocol)
  11. Entity Framework First Release
    1. EDMX Criticized by Agile Developers
    2. Hard to Unit Test: Methods interact with Database
    3. Classes are Tightly Bound with EF
    4. All classes need to inherit from EntityObject that responsible for providing relationships and tracking
    5. ObjectContext remove these dependencies by acquiring relationships and change tracking
  12. EF Inheritance
    1. Table Per Hierarchy
      1. Use Discriminator
        1. Not Normalized
        2. Better Performance, Less Join
        3. All Properties are nullable
    2. Table Per Type
      1. Table for Each specific Type; Abstract class has common properties, inherited type has specific properties
        1. Joins are high
        2. Create Indexes to tune performances
      2. Id is primary key for all tables
    3. Table Per Concrete Type
      1. Duplicate the data columns
      2. If you want to access abstract class properties values have to query all concrete classes
  13. Data Loading
    1. Lazy Loading
      1. Best Practise Turn off use eager Loading
    2. Eager Loading
      1. Use include with Query
    3. Explicit Loading
      1. Use Load method to load
  14. Performance