From the course: Practical Application Architecture with Entity Framework Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

View model mapping

View model mapping - Entity Framework Tutorial

From the course: Practical Application Architecture with Entity Framework Core

Start my 1-month free trial

View model mapping

- [Instructor] Mapping to and from view models can be very tedious and error prone. In this video I'm going to talk about some options that exist to simplify the mapping process. The first option is to just use the business objects directly within the view models. This is generally not recommended. While it prevents having to do any mapping, very rarely does the benefit outweigh the issues. First, this couples the view model to the business model, which might not seem like an issue at first, but it will make refactoring harder and could be a significant issue when business objects change in implementation but the view doesn't need to. Business objects usually have more information than is needed for any given view. For example, updating the contact information for a salesperson doesn't update the whole salesperson, so it shouldn't be possible for that screen to update more than the contact information. Actions that a user perform within a view in a real application usually contain…

Contents