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 @@ -48,16 +48,19 @@ public PropertyInfo GetIdProperty(Type type)
4848
4949 var idPropCache = _idProperties . Value ;
5050
51- if ( idPropCache . TryGetValue ( type , out idprop ) ) return idprop ;
52-
53- //TODO: Enable attribute-based determination
51+ lock ( idPropCache )
52+ {
53+ if ( idPropCache . TryGetValue ( type , out idprop ) ) return idprop ;
54+
55+ //TODO: Enable attribute-based determination
5456
55- idprop = type . GetProperty ( "Id" ) ;
57+ idprop = type . GetProperty ( "Id" ) ;
5658
57- if ( idprop == null )
58- throw new InvalidOperationException ( String . Format ( "Unable to determine Id property for type {0}" , type ) ) ;
59+ if ( idprop == null )
60+ throw new InvalidOperationException ( String . Format ( "Unable to determine Id property for type {0}" , type ) ) ;
5961
60- _idProperties . Value . Add ( type , idprop ) ;
62+ idPropCache . Add ( type , idprop ) ;
63+ }
6164
6265 return idprop ;
6366 }
You can’t perform that action at this time.
0 commit comments