Skip to content

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

Closed

Description

@dennis-apter

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
}

Activity

  1. tl24 commented on Sep 27, 2014

    @tl24

    I'm having the same issue as well

  2. mgravell commented on Sep 27, 2014

    @mgravell
    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" [email protected] 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.

  3. mgravell commented on Sep 29, 2014

    @mgravell
    Member

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

    On 27 September 2014 10:40, Marc Gravell [email protected] 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" [email protected] 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

  4. mgravell commented on Sep 29, 2014

    @mgravell
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions