public bool TryGet(TKey1 key, out TItem item) { TKey1 processedKey = PreProcessKey1(key); item = default(TItem); if (_standardCollection.Contains(processedKey)) { item = _standardCollection[processedKey]; return(true); } else { return(false); } }
/// <summary> /// <para>设置实体的select_display_keys属性</para> /// <para>指定的key要存在与实体的key中</para> /// <para>连式操作</para> /// </summary> /// <param name="select_display_keys"></param> public rx_entity set_select_display_keys(params string[] select_display_keys) { if (select_display_keys != null) { KeyCollection keys = this.Keys; for (int i = 0; i < select_display_keys.Length; i++) { if (!keys.Contains(select_display_keys[i])) { throw new Exception(string.Format("该实体对象中不包含key:{0}", select_display_keys[i])); } } } this._select_display_keys = select_display_keys; return(this); }
/// <summary> /// 设置实体的where_key属性 /// 指定的key要存在与实体的key中 /// </summary> /// <param name="where_keys"></param> public rx_entity set_where_keys(params string[] where_keys) { if (where_keys != null) { KeyCollection keys = this.Keys; for (int i = 0; i < where_keys.Length; i++) { if (!keys.Contains(where_keys[i])) { throw new Exception(string.Format("该实体对象中不包含key:{0}", where_keys[i])); } } } this._where_keys = where_keys; return(this); }
public bool ContainsKey(string key) { return(keys.Contains(key)); }