Git Product home page Git Product logo

Comments (7)

borisdj avatar borisdj commented on August 16, 2024

Please write more info:
Entity class definition your are trying to Insert and
test example of values in the model list.
You could also download the library, add that code into TestProject, and try to reproduce it there.
Or in your project replace Nuget with the Source library and then debug it.

from efcore.bulkextensions.

mfahadi avatar mfahadi commented on August 16, 2024

Thanks for the prompt response.

My mistake, was using version 2.0.9 with e.f core version 2.0, installed the 2.0.8 version and it seems to go through alright.

Found a bug while debugging this. When using a namespace with tables the extensions don not add square brackets with namespace. For namespace [Payment] it sends the query as Payment.[UserTransaction] which would break if some one is using a keyword as namespace name.

from efcore.bulkextensions.

borisdj avatar borisdj commented on August 16, 2024

Could you explain more what do you mean by Namespace in the SQL sense?
Db schema or something else ?

from efcore.bulkextensions.

mfahadi avatar mfahadi commented on August 16, 2024

from efcore.bulkextensions.

borisdj avatar borisdj commented on August 16, 2024

Added brackets [ ] around DbSchema, NuGet 2.1.3

from efcore.bulkextensions.

mfahadi avatar mfahadi commented on August 16, 2024

Great, thanks.

I was wondering if it is possible for you to add and example on how one might save related entities, both with bulk insert.

For example, we have a "Parent" entity and "Child" entity.

class Parent { int id , string name }
class Child { int id, int name, int ParentId }

Both have one to one relationship.

Both collections are populated, with child referring to Parent but no ParentId yet, as Parent is not saved.
First we insert a list of "Parent" with bulk insert, with setoutputidentity config set to true.
Parent collection is saved in db and Id property gets updated. Now the question is how do this change can be propagated to Child. I have tried adding them both to DbContext as AddRange() but still the foreign key of Child is not populated.

Thanks

from efcore.bulkextensions.

borisdj avatar borisdj commented on August 16, 2024

In the following issue there is an example:
#53
I will see to copy part of this into README so that it's more visible.

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.