@@ -319,16 +319,14 @@ public DateTime LastModified {
319319 get {
320320
321321 /*----------------------------------------------------------------------------------------------------------------------
322- | Return minimum date value, if LastModified is not already populated
322+ | Establish default value
323323 \---------------------------------------------------------------------------------------------------------------------*/
324- if ( String . IsNullOrWhiteSpace ( Attributes . GetValue ( "LastModified" , "" ) ) ) {
325- return DateTime . MinValue ;
326- }
324+ var defaultValue = VersionHistory . Count > 0 ? VersionHistory . LastOrDefault ( ) : DateTime . MinValue ;
327325
328326 /*----------------------------------------------------------------------------------------------------------------------
329327 | Return converted string attribute value, if available
330328 \---------------------------------------------------------------------------------------------------------------------*/
331- var lastModified = Attributes . GetValue ( "LastModified" ) ;
329+ var lastModified = Attributes . GetValue ( "LastModified" , defaultValue . ToString ( ) ) ;
332330
333331 // Return converted DateTime
334332 if ( DateTime . TryParse ( lastModified , out var dateTimeValue ) ) {
@@ -338,9 +336,7 @@ public DateTime LastModified {
338336 /*----------------------------------------------------------------------------------------------------------------------
339337 | Otherwise, return default of minimum value
340338 \---------------------------------------------------------------------------------------------------------------------*/
341- else {
342- return DateTime . MinValue ;
343- }
339+ return defaultValue ;
344340
345341 }
346342 set => SetAttributeValue ( "LastModified" , value . ToString ( ) ) ;
0 commit comments