File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,19 @@ public PropertyInfo GetIdProperty(Type type)
4242
4343 var idPropCache = _idProperties . Value ;
4444
45- if ( idPropCache . TryGetValue ( type , out idprop ) ) return idprop ;
46-
47- //TODO: Enable attribute-based determination
45+ lock ( idPropCache )
46+ {
47+ if ( idPropCache . TryGetValue ( type , out idprop ) ) return idprop ;
48+
49+ //TODO: Enable attribute-based determination
4850
49- idprop = type . GetProperty ( "Id" ) ;
51+ idprop = type . GetProperty ( "Id" ) ;
5052
51- if ( idprop == null )
52- throw new InvalidOperationException ( String . Format ( "Unable to determine Id property for type {0}" , type ) ) ;
53+ if ( idprop == null )
54+ throw new InvalidOperationException ( String . Format ( "Unable to determine Id property for type {0}" , type ) ) ;
5355
54- _idProperties . Value . Add ( type , idprop ) ;
56+ idPropCache . Add ( type , idprop ) ;
57+ }
5558
5659 return idprop ;
5760 }
You can’t perform that action at this time.
0 commit comments