So far this chapter has focused on a code-first approach for generating a local database. To reiterate, code-first is the recommended approach for developing on the phone. The database-first approach, however, can also be used, although it is not fully supported.
SqlMetal is a command-line tool used to generate an entity model from a database. SqlMetal is not fully compatible with Windows Phone, because the code it generates does not compile until some minor alterations are made to it.
SqlMetal generates a
DataContext derived class and entities representing database tables. Associations are inferred from the foreign key relationships in the database.
SqlMetal can be launched via a Visual Studio Command Prompt by ...