public List <ForeignKeyProperty> GetList() { //Caching list //Dictionary cannot have items deleted from it so state will be constant unless Dictionary gets longer if (ModelPropertiesList.Count != ModelPropertiesDict.Count) { ModelPropertiesList = ModelPropertiesDict.Select(x => x.Value).ToList(); } return(ModelPropertiesList); }
/// <summary> /// Will add the property if it does not already exist /// </summary> /// <param name="property"></param> /// <param name="attribute"></param> public bool Add(PropertyInfo property, ForeignKeyAttribute attribute, PropertyInfo foreignKeyReferenceProperty) { return(ModelPropertiesDict.TryAdd(property.Name, new ForeignKeyProperty(property, attribute, foreignKeyReferenceProperty))); }