Equals and Contains for text search I am trying to implement a search routine for an application written in C#. The requirements are as follows:

The user can select one of the following options for search:


Property Search(Exact): the text entered in the search box has to match exactly with the results, e.g. searching for PL should only show the results whose properties contain PL.
Property Search(Contains): the text entered in the search box can be part of the results, e.g. searching for PL should show all the results whose properties contain PL, e.g. PLApp, Planning, playing, etc. 


I have implemented it in my code by passing a boolean flag to my method, and using if..else to perform the searches accordingly. 

    public override bool PropertySearch(string value, bool searchPartial = false)
    {
        if(searchPartial)
        {
            if (dataValue.IndexOf(value, StringComparison.OrdinalIgnoreCase) &gt;= 0)
                return true;
        } else
        {
            if (dataValue.Equals(value, StringComparison.OrdinalIgnoreCase))
                return true;
        }
        return false;
    }


This was my first implementation, and I have a feeling there might be a better and concise way to achieve this. Any thoughts?
The flow control seems excessively verbose.  This would do the same:

public override bool PropertySearch(string value, bool searchPartial = false)
{
    return searchPartial ? (dataValue.IndexOf(value, StringComparison.OrdinalIgnoreCase) &gt;= 0)
                         :  dataValue.Equals(value, StringComparison.OrdinalIgnoreCase);
}


I would also question your decision to lump these two operations together into the same method.  The code would likely be clearer if you wrote two separate methods.  But you haven't shown the superclass or rest of this class, so I can't say for sure.