BuildYourOwnDAL.Metadata.TableInfo.AddReference C# (CSharp) Method

AddReference() public method

public AddReference ( ReferenceInfo reference ) : void
reference ReferenceInfo
return void
        public void AddReference(ReferenceInfo reference)
        {
            if (references.ContainsKey(reference.Name))
            {
                throw new InvalidOperationException(string.Format("An item with key {0} has already been added", reference.Name));
            }

            references.Add(reference.Name, reference);
        }

Usage Example

Esempio n. 1
0
 private void AddReferenceInfo(TableInfo tableInfo, PropertyInfo propertyInfo, ReferenceAttribute referenceAttribute)
 {
     tableInfo.AddReference(new ReferenceInfo(this, referenceAttribute.ColumnName, propertyInfo.PropertyType, propertyInfo));
 }