Beispiel #1
0
        public static T GetValue <T>(this StateBag bag, string key, T defaultValue) where T : class
        {
            if (!bag.HasKey(key))
            {
                return(defaultValue);
            }

            return(bag[key] as T);
        }