title: Is this a suitable use of a transaction to find the serial number of the last person with a shared surname?
body: <p>I need to generate an <code>ApplicantNumber</code> with three surname digits, then the count of people with that surname. This is my first attempt. I think the serializable transaction should prevent any duplicates. Will it?</p>
  
  <pre><code>public string GenerateApplicantNumber(string surname)
  {
      using (new TransactionScope(TransactionScopeOption.RequiresNew, new TransactionOptions {IsolationLevel = IsolationLevel.Serializable}))
      {
          return string.Format("{0}{1}", surname.Substring(0, Math.Min(Regex.Replace(surname, @"\s+", "").Length, 3)),
                                  _profileService.ReadApplicantProfiles().Count(p =&gt; !p.IsDeleted &amp;&amp; p.LastName == surname));
      }
  }
  </code></pre>