Skip to content

Conversation

@ajcvickers
Copy link
Contributor

@ajcvickers ajcvickers commented Dec 26, 2022

Fixes #10753

Builds an ad-hoc entity type and uses it to query when SqlQuery is called for a type that does not have a type mapping.

Things to consider:

  • The entity type cannot have relationships
  • Properties are mapped by convention and mapping attributes are respected.
  • The entity types are keyless.

@ajcvickers ajcvickers requested review from a team and AndriySvyryd December 26, 2022 10:37
@AndriySvyryd
Copy link
Member

If we are going this route, then I think it would make sense to use the same conventions used by the model building. We could run ConfigureConventions, remove the key and relationship discovery conventions and ignore all the types already mapped.
This way the result would be more predictable, and the user has a way of influencing it.

@ajcvickers ajcvickers force-pushed the WhatIfWeDidThis1224 branch from 74bd92d to df94994 Compare January 9, 2023 14:14
@ajcvickers ajcvickers changed the title Proof of concept: ad-hoc entity types Raw SQL queries for unmapped types Jan 9, 2023
@ajcvickers ajcvickers marked this pull request as ready for review January 9, 2023 14:15
@ajcvickers
Copy link
Contributor Author

@dotnet/efteam This is now ready for review.

Fixes #10753

Builds an ad-hoc entity type and uses it to query when `SqlQuery` is called for a type that does not have a type mapping.

Things to consider:

- The entity type cannot have relationships
- Properties are mapped by convention and mapping attributes are respected.
- The entity types are keyless.
@ajcvickers
Copy link
Contributor Author

@AndriySvyryd Updated.

Fixes #10753

Builds an ad-hoc entity type and uses it to query when `SqlQuery` is called for a type that does not have a type mapping.

Things to consider:

- The entity type cannot have relationships
- Properties are mapped by convention and mapping attributes are respected.
- The entity types are keyless.
@ajcvickers ajcvickers merged commit 38e9767 into main Jan 12, 2023
@ajcvickers ajcvickers deleted the WhatIfWeDidThis1224 branch January 12, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support raw SQL queries without defining an entity type for the result

7 participants