Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor reverse engineering API #3423

Merged
merged 1 commit into from
Oct 15, 2015
Merged

Refactor reverse engineering API #3423

merged 1 commit into from
Oct 15, 2015

Conversation

natemcmaster
Copy link
Contributor

This splits reverse engineering at several levels. The entry point for provider writers is MetadataModelProvider.GetModel().
The framework provides some implementation helpers.

  • MetadataModelProvider has a protected method AddNavigationProperties which should be called on a mostly-ready IModel. This will add navprops for all foreign keys.
  • Providers can implement RelationalMetadataModelProvider. If given SchemaInfo and a type mapper, it will build and IModel.
  • Providers can override methods in RelationalMetadataModelProvider to get specific control over how metadata is build, if the default is unsuitable.

Closes #3404, #3077, #3288, #3247 and #3329.

TODO
[ ] also update how a provider passes their UseProvider() method name to the code gen step.
[ ] move everything to M.D.E.Scaffolding (.Internal)

@@ -1 +1 @@
// Unable to generate EntityType TableWithUnmappablePrimaryKeyColumn. Unable to identify any primary key columns in the underlying SQL Server table [dbo].[TableWithUnmappablePrimaryKeyColumn].
// Unable to generate EntityType TableWithUnmappablePrimaryKeyColumn. Unable to identify the primary key for table 'TableWithUnmappablePrimaryKeyColumn'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the schema name for SQL Server tables.

@lajones
Copy link
Contributor

lajones commented Oct 14, 2015

:shipit: with agreed changes.

@natemcmaster natemcmaster force-pushed the namc/design branch 3 times, most recently from 811b710 to 61c9856 Compare October 15, 2015 17:12
This splits reverse engineering at several levels. The entry point for provider writers is MetadataModelProvider.GetModel().
The framework provides some implementation helpers.

 - MetadataModelProvider has a protected method 'AddNavigationProperties' which should be called on a mostly-ready IModel. This will add navprops for all foreign keys.
 - Providers can implement RelationalMetadataModelProvider. If given SchemaInfo and a type mapper, it will build and IModel.
 - Providers can override methods in RelationalMetadataModelProvider to get specific control over how metadata is build, if the default is unsuitable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants