Skip to content

Mixing Database Functions and Value Conversions #16617

Description

Is there a way to use database functions and value conversions together in the way described in this question https://stackoverflow.com/questions/56261258/mixing-ef-core-convensions-and-dbfunction-for-a-jobject-property or is this feature is planned for a future release ?

Activity

  1. ajcvickers commented on Jul 19, 2019

    @ajcvickers
    Contributor

    Triage: putting this on the backlog as a more specific case of #10434

  2. added this to the Backlog milestone on Jul 19, 2019
  3. smitpatel commented on Oct 15, 2020

    @smitpatel
    Contributor

    For the original question posted in stackoverflow
    Since 3.1, you can specify the store type for the parameter as follows

    modelBuilder.HasDbFunction( typeof(MyDbContext).GetMethod(nameof(JsonValue)))
                          .HasName("JSON_VALUE")
                          .HasParameter("column")
                          .HasStoreType("nvarchar(max)")

    This will configure the store type for the parameter. It will pass the validation and also treat the value being used there as of type nvarchar on server.

  4. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions