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

When using the BulkReadAsync() method, data with pre-existing records in the database exhibits a zero value for the identity column in query outcomes. #1468

Open
CalmlyCC opened this issue Apr 22, 2024 · 0 comments

Comments

@CalmlyCC
Copy link

Content:

  • Technical context: Running on .NET 5.0 with EFCore.BulkExtensions version 5.4.2 against a SQL Server 2014 database.
  • Issue description: Despite the presence of existing data in the database, when employing the BulkReadAsync() function, the identity field's value is returned as zero in the fetched results.
  • Steps to reproduce:
    1. Execute a query to retrieve an existing record containing a decimal-type property.
    2. The schema of the table under consideration defines a decimal field with specifications of decimal(18,2).
    3. Example dataset: The same numerical value is represented internally in C# as 10.3 and externally in the database as 10.30.
  • Expected behavior: The expected behavior would be for the query to correctly retrieve and display the actual identity field value for such existing records.
  • Observed behavior: However, the identity field in the returned query results unexpectedly contains a value of zero.
  • Tentative cause speculation (optional): One possible hypothesis is that during the execution of the GetUniquePropertyValues() method, numeric values may be inadvertently stringified through a conversion to strings by means of ToString(), which could lead to incorrect handling or representation of identity values.
    uniqueBuilder.Append(property?.ToString() ?? "null");
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

1 participant