title: LINQ expression for exact match of part of string in Entity framework
body: <p>I tried to get list of <code>MasterDto</code> using following query.But it didnt return expected result.So i want to get exact match results of given pattern.</p>
  
  <pre><code> // Department Code like AB,ABC,BC,...etc.
      string jobNumberPrefixPattern= departmentCode; 
  
   MasterDto reportDto = unitOfWork.GetRepository&lt;MasterDto&gt;().LinqQuery
                                  (m =&gt; m.CreateUserid.ToUpper() == userName.ToUpper()
                                        &amp;&amp; m.JobNumberTemp.StartsWith(jobNumberPrefixPattern))
                                   .OrderByDescending(m =&gt; m.MasterPk)
                                   .FirstOrDefault();
  </code></pre>
  
  <p><code>JobNumberTemp</code> is string field and its created based on departmentCode and next value of number.samples are like as follows.</p>
  
  <ul>
  <li>AB-0001</li>
  <li>AB-0002</li>
  <li>ABC-0001</li>
  </ul>
  
  <p>Here I used <code>string.StartsWith</code> , instead of using this is there any suggestions to do ?</p>