I created a custom module using the module builder. I am trying to search for all of the published items for its type. The problem is that the ExpirationDate is always null. Here is the code I use to retrieve the items:
var query =
" Visible = true AND Status = Live AND PublicationDate <= DateTime.UtcNow AND (!ExpirationDate.HasValue OR ExpirationDate > DateTime.UtcNow) "
var items = App.WorkWith().AnyContentItem(type).Manager.GetItems(type, query,
.Empty, 0, 0);
I generated the type with TypeResolutionService.ResolveType(...); Items come back but their ExpirationDate is null. Items that have an expiration date before the current date also come back and I don't want them too.