Skip to the content.

You can indicate an expected row-count via either a constant method-level [RowCountHint(...)] or a member-level [RowCountHint] on the parameter type (for variable hints), but you should not specify both. The member-level value will be preferred, so you should probably remove the method-level hint.

Bad:

[RowCountHint(42)]
public void SomeMethod()
{
    connection.Query("somesql", new SomeArgsType
    {
        //
        SizeHint = 15,
    }
}

class SomeArgsType
{
    // ...
    [RowCountHint]
    public int SizeHint {get;set;}
}

Good:

public void SomeMethod()
{
    connection.Query("somesql", new SomeArgsType
    {
        //
        SizeHint = 15,
    }
}

class SomeArgsType
{
    // ...
    [RowCountHint]
    public int SizeHint {get;set;}
}