November Happy Hour will be moved to Thursday December 5th.

Error when retrieving .ToList()

Vote:
 

We are doing the following on version 8.8.0 site and it is working.

 

public static IEnumerable FindAll()

        {

            var store = typeof(T).GetStore();

            return store.Items();

        }

 

However, when we attempt the below on version 9.12.0, I am getting a NullReference exception when I call items.ToList(). The strange thing is if I do items.Count(), it actually returns the 3 items saved in the store.

 

public static IEnumerable GetItems()

        {

            var store = typeof(CalHIINCommitmentAgreement).GetStore();

            var items = store.Items();

 

            if (items != null)

                return items.ToList();

 

            return new List();

        }

#171223
Nov 03, 2016 1:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.