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

Prevent multiexecute on parameters with type IDynamicMetaObjectProvider or IEnumerable<KeyValuePair<string, object>> #151

Closed
dennis-apter opened this issue Aug 28, 2014 · 4 comments

Comments

@dennis-apter
Copy link

I use ExpandoObject for initialize Execute() method parameters. If take a look at SqlMapper.Execute() method, multiExec enabled for IEnumeable param, but it's unexpected behavior with ExpandoObject. Please, refine conditions like this:

if (multiExec != null && !(multiExec is string) &&
    // additional conditions:
    !(multiExec is IDynamicMetaObjectProvider) &&
    !(multiExec is IEnumerable<KeyValuePair<string, object>>))
{
    // execute as multiExec
}
@tl24
Copy link

tl24 commented Sep 27, 2014

I'm having the same issue as well

@mgravell
Copy link
Member

Yep, that sounds undesirable - possibly a regression; I'll try to deploy an
update this weekend.
On 28 Aug 2014 05:59, "Dennis Apter" notifications@github.com wrote:

I use ExpandoObject for initialize execute parameters. If take a look at
SqlMapper.Execute() method, multiExec enables on IEnumeable param, but it's
unexpected behavior with ExpandoObject. Please, add additional conditions
like this:

if (multiExec != null && !(multiExec is string) && !(multiExec is IDynamicMetaObjectProvider) && !(multiExec is IEnumerable<KeyValuePair<string, object>>)){
// execute as multiExec}


Reply to this email directly or view it on GitHub
#151.

@mgravell
Copy link
Member

1.35 released - currently not the default, while I dogfood it etc, but is
available

On 27 September 2014 10:40, Marc Gravell marc.gravell@gmail.com wrote:

Yep, that sounds undesirable - possibly a regression; I'll try to deploy
an update this weekend.
On 28 Aug 2014 05:59, "Dennis Apter" notifications@github.com wrote:

I use ExpandoObject for initialize execute parameters. If take a look at
SqlMapper.Execute() method, multiExec enables on IEnumeable param, but it's
unexpected behavior with ExpandoObject. Please, add additional conditions
like this:

if (multiExec != null && !(multiExec is string) && !(multiExec is IDynamicMetaObjectProvider) && !(multiExec is IEnumerable<KeyValuePair<string, object>>)){
// execute as multiExec}


Reply to this email directly or view it on GitHub
#151.

Regards,

Marc

@mgravell
Copy link
Member

Now working fine in production stackoverflow.com etc, so released as default NuGet package. I'm assuming this is now closed, unless I hear "that still doesn't work"

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

3 participants