File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Orchard.Web/Modules/Lucene/Models Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,19 @@ public bool GetBoolean(string name)
3838 public string GetString ( string name )
3939 {
4040 var field = _doc . GetField ( name ) ;
41- return field == null ? null : field . StringValue ;
41+ return field ? . StringValue ;
4242 }
4343
4444 public DateTime GetDateTime ( string name )
4545 {
4646 var field = _doc . GetField ( name ) ;
4747 return field == null ? DateTime . MinValue : DateTools . StringToDate ( field . StringValue ) ;
4848 }
49+
50+ public DateTime ? GetNullableDateTime ( string name )
51+ {
52+ var field = _doc . GetField ( name ) ;
53+ return field == null ? default ( DateTime ? ) : DateTools . StringToDate ( field . StringValue ) ;
54+ }
4955 }
5056}
Original file line number Diff line number Diff line change @@ -11,5 +11,6 @@ public interface ISearchHit
1111 bool GetBoolean ( string name ) ;
1212 string GetString ( string name ) ;
1313 DateTime GetDateTime ( string name ) ;
14+ DateTime ? GetNullableDateTime ( string name ) ;
1415 }
1516}
You can’t perform that action at this time.
0 commit comments