private void SetParent(TTargetEntity entity) { if (SourcePropertyName.HasValue()) { entity.Reflection().Set(SourcePropertyName, default(TSourceEntity)); } }
/// <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); } }
private void AddLink(TTargetEntity entity) { if (SourcePropertyName.HasValue()) { entity.Reflection().Set(SourcePropertyName, Source.Entity); } Collection.Add(entity); Context.AddLink(Source.Entity, TargetPropertyName, entity); }