SelectCount by Three options ObjectDataSource
<p>I need a count for the GetUsers but I have 3 different calculations either by alpha, search and byEmail parameters what can I do in this situation for my ObjectDataSource SelectCount method</p>

<pre><code>public class Users
{
    public IList&lt;MembershipUser&gt; GetUsers(string alpha, string search, bool byEmail, int startRowIndex, int maximumRows)
    {
        IList&lt;MembershipUser&gt; users = null;

        if (alpha != null &amp;&amp; search == null)
        {
            users = Membership.GetAllUsers().Cast&lt;MembershipUser&gt;().Where(x =&gt; x.UserName.StartsWith(alpha) == true).ToList();
        }
        else if (search != null &amp;&amp; !byEmail)
        {
            users = Membership.FindUsersByName(search).Cast&lt;MembershipUser&gt;().Skip(maximumRows * startRowIndex).Take(maximumRows).ToList();
        }
        else
        {
            users = Membership.FindUsersByEmail(search).Cast&lt;MembershipUser&gt;().Skip(maximumRows * startRowIndex).Take(maximumRows).ToList();
        }

        return users;

    }

    public int GetUserCount()
    {

    }
</code></pre>

<p>Updated C#:</p>

<pre><code>    public IEnumerable&lt;MembershipUser&gt; GetUsers(string alpha, string searchBy, string searchText, int startRowIndex, int maximumRows)
    {
        var users = Membership.GetAllUsers().Cast&lt;MembershipUser&gt;();

        if (alpha != null &amp;&amp; string.IsNullOrEmpty(searchBy))
        {
            users = users
                .Where(x =&gt; x.UserName.StartsWith(alpha, StringComparison.OrdinalIgnoreCase))
                .Skip(maximumRows * startRowIndex)
                .Take(maximumRows).ToList();
        }
        else if (searchBy == "User Name" &amp;&amp; !string.IsNullOrEmpty(searchText))
        {
            users = users.Where(x =&gt; x.UserName == searchText)
                .Skip(maximumRows * startRowIndex)
                .Take(maximumRows).ToList();
        }
        else if (searchBy == "Email" &amp;&amp; !string.IsNullOrEmpty(searchText))
        {
            users = users.Where(x =&gt; x.Email == searchText)
                .Skip(maximumRows * startRowIndex)
                .Take(maximumRows).ToList();
        }
        else
        {
            users = null;
        }

        return users;

    }
</code></pre>
