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

Support casting db types #3942

Closed
natemcmaster opened this issue Dec 2, 2015 · 1 comment
Closed

Support casting db types #3942

natemcmaster opened this issue Dec 2, 2015 · 1 comment

Comments

@natemcmaster
Copy link
Contributor

Casting db types not supported first-class. This can only be accomplished with FromSql.

sys.index_columns.key_ordinal is BIT which maps to byte.
ColumnModel.PrimaryKeyOrdinal is int. Materializing throws an InvalidCastException.

Workaround:

  • .FromSql() with CAST (ic.key_ordinal AS INT)

Could overlap with a solution for #3932

@rowanmiller
Copy link
Contributor

Triage: This scenario is a dupe of #242. That feature would probably support this by reading it back as BIT but then allowing you to map it to an int property (rather than doing the conversion inline in the query).

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
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

No branches or pull requests

3 participants