ApplicantNumber
3 桁の姓を生成し、次にその姓を持つ人の数を生成する必要があります。これは私の最初の試みです。シリアライズ可能なトランザクションは重複を防ぐべきだと思います。しますか?
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 => !p.IsDeleted && p.LastName == surname));
}
}