Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By : Richard L Helton
Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By: Richard L Helton

Overview of this book

Table of Contents (15 chapters)
Mastering NServiceBus and Persistence
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Entity Framework snippets


We have ventured into creating models in MVC and EF from an existing database. There will be many cases where the database is not created. We listed previous examples and described in previous chapters how to manually create a database, but many ESB developers don't use SQL Server Management Studio, or SQL scripts, very often. We will get into some details on how to create tables from either EF code or models. There will be no SQL discussed here as we use objects to build tables and populate them. EF plays a major role in reading and writing to the SQL Server database. Since NSB will likely be deployed on a Windows Server machine to handle the enterprise objects, it is natural that SQL Server will be used as well for many of the Microsoft components.

Creating tables with EF

So far, the examples have shown us how to read messages in EF. We chose Entity Frameworks to monitor and build SQL Server tables as Entity Framework works well inside Visual Studio for modeling...