99using System . Collections . Generic ;
1010using System . Linq ;
1111using System . Reflection ;
12+ using System . Runtime . CompilerServices ;
1213using System . Security . Cryptography ;
1314using System . Text ;
1415using Xtensive . Core ;
2021using Xtensive . Orm . Weaving ;
2122using Xtensive . Reflection ;
2223using FieldInfo = Xtensive . Orm . Model . FieldInfo ;
23- using Module = System . Reflection . Module ;
2424using TypeInfo = Xtensive . Orm . Model . TypeInfo ;
2525
2626namespace Xtensive . Orm . Providers
@@ -38,15 +38,15 @@ public sealed class NameBuilder
3838 private const string ReferenceForeignKeyFormat = "FK_{0}_{1}_{2}" ;
3939 private const string HierarchyForeignKeyFormat = "FK_{0}_{1}" ;
4040
41- private readonly ConcurrentDictionary < PropertyInfo , string > fieldNameCache =
42- new ConcurrentDictionary < PropertyInfo , string > ( ) ;
43- private static readonly Func < PropertyInfo , string > _fieldNameCacheValueFactory =
41+ private static readonly Func < PropertyInfo , string > fieldNameCacheValueFactory =
4442 field => field . GetAttribute < OverrideFieldNameAttribute > ( ) ? . Name ?? field . Name ;
4543
4644 private readonly int maxIdentifierLength ;
4745 private readonly NamingConvention namingConvention ;
4846 private readonly bool isMultidatabase ;
4947 private readonly string defaultDatabase ;
48+ private readonly ConcurrentDictionary < PropertyInfo , string > fieldNameCache =
49+ new ConcurrentDictionary < PropertyInfo , string > ( ) ;
5050
5151 /// <summary>
5252 /// Gets the <see cref="Entity.TypeId"/> column name.
@@ -186,16 +186,17 @@ public string BuildFieldName(FieldDef field)
186186 return result ;
187187 }
188188
189+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
189190 private string BuildFieldNameInternal ( PropertyInfo propertyInfo )
190- => fieldNameCache . GetOrAdd ( propertyInfo , _fieldNameCacheValueFactory ) ;
191+ => fieldNameCache . GetOrAdd ( propertyInfo , fieldNameCacheValueFactory ) ;
191192
192193 /// <summary>
193194 /// Builds the name of the field.
194195 /// </summary>
195196 /// <param name="propertyInfo">The property info.</param>
196197 public string BuildFieldName ( PropertyInfo propertyInfo )
197198 {
198- ArgumentValidator . EnsureArgumentNotNull ( propertyInfo , nameof ( propertyInfo ) ) ;
199+ ArgumentValidator . EnsureArgumentNotNull ( propertyInfo , " propertyInfo" ) ;
199200 return BuildFieldNameInternal ( propertyInfo ) ;
200201 }
201202
0 commit comments