* Some key points of the DbContext API
*
* db. Categories.find ()-Finds an entity by passing a primary key value as a parameter, and a composite primary key passes multiple parameters
* db. Categories.add ()-Adds a new entity to the context
* db. Categories.attach ()-Adds an existing entity to the context
* db. Entry (entity). state = System.Data.EntityState.Modified-Modify Entity status
* db. Categories.asnotracking ()-an entity that is not tracked by the Context through NoTracking, and whose state is Detached state. It can be used only when data is obtained, which helps to improve efficiency.
* Property related operation, when the property changes, will automatically monitor the entity state, that is ismodified = True
* db. Entry (product). Property (P = p.name). CurrentValue
* db. Entry (product). Property ("Name"). CurrentValue
* Method of direct loading (Eager loading)
* db. Categories.include (P = p.products.first ())
* db. Categories.include (p = p.products)
* db. Entry (product). Reference (p = p.category). Load ()
* Using SQL
* db. Categories.sqlquery ("SELECT * from Categories"). ToList ()//entities in the case
* db. Database.sqlquery<string> ("Select Name from Categories"). ToList (); Non-entity situation
* db. Database.executesqlcommand (SQL); Execute SQL directly