Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Providing Multiple Targeted Contexts in ... > Reusing Classes, Configurations, and...

Reusing Classes, Configurations, and Validation Across Multiple Contexts

Throughout this book you’ve seen us attempt to organize and refactor code as our application grew. From the beginning, we’ve kept the domain classes in their own project. If you have read Programming Entity Framework: Code First, you saw that when we used the Fluent API to configure our entities, we created separate classes to contain the Fluent configuration logic for each type. In the validation chapters, you saw that we encapsulated logic from the ValidateEntity method so that the method wouldn’t get loaded down with details of each custom validation being performed. Organizing logic in this way makes it easier to reuse that logic and lets us share classes and logic across our multiple contexts.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial