Quantcast
Viewing all articles
Browse latest Browse all 9076

episerver dds generics returns no value

Hi

I am using EPIServer 8.12.

I've implemented a class using dds. The problem is when I turn my class to a generic class and I pass the same class if returns no value.

for instance, I have this code which works fine and returns 8 lines:

  var items = store.Items<QueueableEmailItem>().Where(i => i.State == Enums.QueueItemState.Queued || i.State == Enums.QueueItemState.Retrying).ToList();



(QueueableEmailItem : IDynamicData)

now I change the code to 

var items = store.Items<T>().Where(i => i.State == Enums.QueueItemState.Queued || i.State == Enums.QueueItemState.Retrying).ToList();
and call it with the same class. (where T : IDynamicData)




it returns no results.

Funny story is that if I change the code to code below which fetchs the class before adding the where clause, it will work fine

var items = store.Items<T>().ToList();
var undoneItems = items.Where(i=> i.State == Enums.QueueItemState.Queued || i.State == Enums.QueueItemState.Retrying).ToList();




Is there any problem with generics?
Anyone know what shall I do?


Viewing all articles
Browse latest Browse all 9076

Trending Articles