Beispiel #1
0
        public static IHasId Get(this IGettableStore store, Type type, object id)
        {
            if (store == null)
            {
                return(null);
            }

            StoredObjectId soId = new StoredObjectId(type, id);

            return(store.Get(soId));
        }
Beispiel #2
0
        public static T Get <T>(this IGettableStore store, object id) where T : IHasId
        {
            if (store == null)
            {
                return(default(T));
            }

            StoredObjectId soId = StoredObjectId.New(typeof(T), id);
            var            item = store.Get(soId);

            if (item == null)
            {
                return(default(T));
            }

            return((T)item);
        }