Git Product home page Git Product logo

Comments (3)

JonathanMagnan avatar JonathanMagnan commented on May 23, 2024 2

Hello @Alexn ,

I should have said it in my first answer: you also need to select which properties you want to output.

Here is a working fork from your latest Fiddle: https://dotnetfiddle.net/XvCPIs

context.Set<Customer>().BulkInsert(customers, options => 
{
	//options.ForceSelectOutput = true;
	options.InsertIfNotExists = true;
	options.InsertKeepIdentity = true;
	options.ColumnOutputExpression = x => new { x.Name, x.Email, x.Note, x.Created, x.Updated   };
	options.ForceOutputFromUnmodifiedRow = true;
});

I commented the option options.ForceSelectOutput = true; as it might not do what you think (This option, instead of directly outputting values, it output in a temporary table then select it, which is required in some scenario such as when we cannot automatically discover the table have a trigger)

from entityframework-extensions.

JonathanMagnan avatar JonathanMagnan commented on May 23, 2024 1

Hello @Alexn ,

Thank for reporting.

Unfortunately, we don't have any solution at this moment to cover this scenario.

We have the option options.ForceOutputFromUnmodifiedRow = true;, but it currently only works in this 2 scenarios:

We currently have a new method under development that will allow you to read and output values directly into your entities, but it will still take several weeks before we complete it.

Best Regards,

Jon

from entityframework-extensions.

Alexn avatar Alexn commented on May 23, 2024

Hello @JonathanMagnan,

Thanks for answer. I tried to use BulkInsert + InsertIfNotExists, and it does not work as expected.

Could you please look in to the Fiddle, and figure out it?

Fiddle

https://dotnetfiddle.net/IY01fw

from entityframework-extensions.

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.