File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Core Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,8 @@ public class AppVersionHelper
19
19
/// Gets release (last build) date of the application.
20
20
/// It's shown in the web page.
21
21
/// </summary>
22
- public static DateTime ReleaseDate
23
- {
24
- get
25
- {
26
- if ( _cachedReleaseDate . HasValue )
27
- return _cachedReleaseDate . Value ;
22
+ public static DateTime ReleaseDate => LzyReleaseDate . Value ;
28
23
29
- _cachedReleaseDate = new FileInfo ( typeof ( AppVersionHelper ) . GetAssembly ( ) . Location ) . LastWriteTime ;
30
-
31
- return _cachedReleaseDate . Value ;
32
- }
33
- }
34
- private static DateTime ? _cachedReleaseDate ;
24
+ private static readonly Lazy < DateTime > LzyReleaseDate = new Lazy < DateTime > ( ( ) => new FileInfo ( typeof ( AppVersionHelper ) . GetAssembly ( ) . Location ) . LastWriteTime ) ;
35
25
}
36
26
}
You can’t perform that action at this time.
0 commit comments