Self-test questions

Q1. Which of the following is NOT a syntax supported by LINQ?

  1. Method.
  2. SQL.
  3. Query.

Q2. If you retrieve an entity via LINQ from a database, make changes to it and call SaveChanges, all properties are updated in the database, not only the changed ones, true or false?

Q3. In order to sort the data by multiple properties, you simply need to call OrderBy multiple times in LINQ that is using the method syntax, true or false?

Q4. How to add two filter conditions to a LINQ query with the query syntax?

  1. Use multiple Where calls.
  2. Use logical AND operator.
  3. Issue two queries.

Q5. You want to add multiple new entities to DbSet. How can you accomplish this?

  1. By calling the Add method and passing an instance of the class specified in the context property.
  2. By calling AddRange and pass an enumerable of the target entity type.
  3. By setting the state to Added using the context API on each new entity.
  4. All of the above.

Q6. If you want to create a new entity with some child entities, also known as object graph, you must call Add on the parent and each child in order to persist the object graph, true or false?

Q7. If you set a state of an entity to modified, all columns in the corresponding table are updated when SaveChanges is called, true or false?

Q8. You need to call Add and then Remove on an entity in order to trigger a delete query to be issued when SaveChanges is called, true or false?

Q9. Which entity state does not result in a query against the database when SaveChanges is called?

  1. Added.
  2. Detached.
  3. Deleted.
  4. Modified.

Q10. Which property of DbSet gives you access to entities already loaded into the context from a database?

  1. Memory.
  2. Local.
  3. Loaded.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.251.206