exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 67 discussion

Actual exam question from Microsoft's 70-487
Question #: 67
Topic #: 1
[All 70-487 Questions]

DRAG DROP -
You are developing a web application that uses the Entity Framework.
You plan to use the table-per-type mapping strategy to store the following data.

You need to implement a mapping strategy that will store the data.
How should you complete the code? To answer, drag the appropriate methods to the correct locations. Each method may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Each correct selection is worth one point.
NOTE:
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: OnModelCreating -

Box 2: Entity -

Box 3: ToTable -
Mapping an Entity Type to a Specific Table in the Database
Example:
All properties of Department will be mapped to columns in a table called t_ Department. modelBuilder.Entity<Department>()
.ToTable("t_Department");

Box 4: Entity -

Box 5: ToTable -
Mapping the Table-Per-Type (TPT) Inheritance
In the TPT mapping scenario, all types are mapped to individual tables. Properties that belong solely to a base type or derived type are stored in a table that maps to that type. Tables that map to derived types also store a foreign key that joins the derived table with the base table. modelBuilder.Entity<Course>().ToTable("Course"); modelBuilder.Entity<OnsiteCourse>().ToTable("OnsiteCourse");
References:
https://msdn.microsoft.com/en-us/library/jj591617(v=vs.113).aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
mr_
4 years, 10 months ago
Correct. It will create separate tables for each model class in the example.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...