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

Query: Infer type mapping from IDbFunction while translating #27995

Merged
merged 1 commit into from
May 11, 2022

Conversation

smitpatel
Copy link
Member

@smitpatel smitpatel commented May 10, 2022

  • We use TypeMapping if configured on the DbFunction, or
  • We try to get it if store type is specified
  • If neither of above work then we do the default type mapping based on return type

Resolves #27954
Resolves #27524

@smitpatel smitpatel changed the title Query: Configure and use TypeMapping on DbFunction Query: Infer type mapping from IDbFunction while translating May 11, 2022
@smitpatel smitpatel merged commit f6988cd into main May 11, 2022
@smitpatel smitpatel deleted the smit/issue27954 branch May 11, 2022 21:04
modelBuilder
.HasDbFunction(typeof(MyEntity).GetMethod(nameof(MyEntity.Modify)))
.HasName("ModifyDate")
.HasStoreType("datetime")
Copy link
Member

@roji roji May 16, 2022

Choose a reason for hiding this comment

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

😿

Not easy to override this for databases which don't have a datetime store type... In any case, this test seems a bit SQL Server-specific, do we want to move it there?

Copy link
Member

Choose a reason for hiding this comment

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

HasStoreType(null) should work

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.

Function StoreType is ignored for DateTime RelationalMethodCallTranslatorProvider and explicit typeMapping
3 participants