GithubHelp home page GithubHelp logo

Comments (4)

JonathanMagnan avatar JonathanMagnan commented on May 23, 2024 1

Hello @VictorioBerra ,

When you use a syntax similar to this:

context.Entity<IEntityType>("mappingkey")
	.UseBulkOptions(options =>
	{
	});

The UseBulkOptions will only apply to this specific entity type whenever this key is used. It will not affect any other bulk operations but only those that use this exact mapping key.

Any configuration, in fact, should only apply only whenever you use this mappingkey and doesn't affect any other chained methods.


However, if you use the UseBulkOperations in the context such as:

context.UseBulkOptions(options => {}).BulkInsert

it will apply to all bulk operations that will be chained.

Let me know if that's more clear.

Best Regards,

Jon

from dapper-plus.

JonathanMagnan avatar JonathanMagnan commented on May 23, 2024

Hello @VictorioBerra

Can we have a feature to pass a string for the column name for ColumnSynchronizeDeleteKeySubsetExpression?

It should already be supported through the option ColumnSynchronizeDeleteKeySubsetNames, which allows you to pass a list of strings representing all the column names you want to use.

Also looks like I cannot apply UseBulkOptions() to ThenBulkMerge()? What is the best way to accomplish what I am trying to do above?

The connection.UseBulkOptions should be only for configurations like BatchSize that you don't mind applying to every bulk operation that chain after.

We usually recommend putting all custom options directly in the mapping and using a mapping key instead: https://dapper-plus.net/getting-started-mapping#mapper-key , which allows you to map an entity type in multiple different ways.

Let me know if you need more help with any of your two questions.

Best Regards,

Jon

from dapper-plus.

VictorioBerra avatar VictorioBerra commented on May 23, 2024

@JonathanMagnan

Okay that answers my questions. UseBulkOptions() will apply to every chained Bulk operation.

I will switch to mapping keys since that seems less "global" and my mappings can apply directly to bulk operations.

Just some extra clarification, ColumnSynchronizeDeleteKeySubsetNames can only be applied via UseBulkOptions and cannot be set in mapping and used with mapping keys right? It applies to the entire bulk operation across all entities?

from dapper-plus.

VictorioBerra avatar VictorioBerra commented on May 23, 2024

Makes sense to me. Thanks!

from dapper-plus.

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.