Skip to content

Commit b7d73f4

Browse files
committed
ReleaseDate cached
1 parent a6f3129 commit b7d73f4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/AppVersionHelper.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ public class AppVersionHelper
2121
/// </summary>
2222
public static DateTime ReleaseDate
2323
{
24-
get { return new FileInfo(typeof(AppVersionHelper).GetAssembly().Location).LastWriteTime; }
24+
get
25+
{
26+
if (_cachedReleaseDate.HasValue)
27+
return _cachedReleaseDate.Value;
28+
29+
_cachedReleaseDate = new FileInfo(typeof(AppVersionHelper).GetAssembly().Location).LastWriteTime;
30+
31+
return _cachedReleaseDate.Value;
32+
}
2533
}
34+
private static DateTime? _cachedReleaseDate;
2635
}
2736
}

0 commit comments

Comments
 (0)