When calling GetAll<T> with an item entry type (line 180). The cast will fail if you're using a custom item entry type and a custom item entry type that forks the base item entry. A LINQ cast is being made and it needs to be converted to a cast type that takes into account potential failure of the conversion.
// Add the items
inventory.Add(generic default item)
inventory.Add(new custom item entry)
// This now fails
var myCustomEntries = inventory.GetAll<MyCustomItemEntry>();
When calling
GetAll<T>
with an item entry type (line 180). The cast will fail if you're using a custom item entry type and a custom item entry type that forks the base item entry. A LINQ cast is being made and it needs to be converted to a cast type that takes into account potential failure of the conversion.