Git Product home page Git Product logo

Comments (5)

borisdj avatar borisdj commented on September 18, 2024

Yes I can.
The problem is in QueryOutputTable method:
context.Set<T>().FromSql<T>(SqlQueryBuilder.SelectFromOutputTable(this));
where OutputTable does not have CalculatedColumn so Query can not Select it but Entity expects it for mapping.
EDIT:
After little more digging I have found that the error if happening even without CalculatedColumn.
Whenever SetOutputIdentity is True and not all columns are being selected either by explicitly selecting with PropertiesToInclude or excluding some with PropertiesToExclude.
This cause mismatch between Select and Entity.

I will see to fix it soon.
I think best solution is that Output should Select all Columns that have EntityProperty, even those that were not Inserted.

from efcore.bulkextensions.

NimeshDhruve avatar NimeshDhruve commented on September 18, 2024

Thanks, I am inserting more than 9 million records (on a daily basis) and I really look forward to use BulkInsert. Regular EF Core takes more than 20mins even with doing things in Parallel.

from efcore.bulkextensions.

borisdj avatar borisdj commented on September 18, 2024

Fixed and NuGet 2.1.2 published.
Also ComputedColumns are now automatically excluded so it's not required to use PropertiesToExclude for their explicit exclusion.

from efcore.bulkextensions.

maxchu92 avatar maxchu92 commented on September 18, 2024

Using 2.1.9 version.

Does not work with GeneratedValue Data Annotation, or FluentAPI.

Data Annotation
public class MyClass {
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public MyProp { get; set; }
}

FluentAPI
modelBuilder.Entity<My_Table>().Property(p => p.MyProp).ValueGeneratedOnAddOrUpdate();

from efcore.bulkextensions.

maxchu92 avatar maxchu92 commented on September 18, 2024

Submitted as a new issue

from efcore.bulkextensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.