コード例 #1
0
 private void SetParent(TTargetEntity entity)
 {
     if (SourcePropertyName.HasValue())
     {
         entity.Reflection().Set(SourcePropertyName, default(TSourceEntity));
     }
 }
コード例 #2
0
        /// <summary>Serves as the default hash function.</summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = base.GetHashCode();
                hashCode = (hashCode * 397) ^ SourcePropertyTypeName.GetHashCode();
                hashCode = (hashCode * 397) ^ SourcePropertyName.GetHashCode();

                return(hashCode);
            }
        }
コード例 #3
0
        private void AddLink(TTargetEntity entity)
        {
            if (SourcePropertyName.HasValue())
            {
                entity.Reflection().Set(SourcePropertyName, Source.Entity);
            }

            Collection.Add(entity);

            Context.AddLink(Source.Entity, TargetPropertyName, entity);
        }