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
1919 /// Gets release (last build) date of the application.
2020 /// It's shown in the web page.
2121 /// </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 ;
2823
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 ) ;
3525 }
3626}
You can’t perform that action at this time.
0 commit comments