Пример #1
0
 /// <param name="targetClass">Class to which this FK points to</param>
 /// <param name="fieldName">Property of this class, to where the FK points to</param>
 /// <exception cref="ArgumentNullException">For the params className and fieldName</exception>
 public ForeignKey(Type targetClass, string fieldName)
 {
     TargetClass = targetClass ?? throw new ArgumentNullException(nameof(targetClass));
     TargetField = TargetClass.GetProperties().Where(x => x.Name == fieldName).First();
 }