/// <summary>
 /// Clones this AnalyticsSourceGivingUnit object to a new AnalyticsSourceGivingUnit object
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="deepCopy">if set to <c>true</c> a deep copy is made. If false, only the basic entity properties are copied.</param>
 /// <returns></returns>
 public static AnalyticsSourceGivingUnit Clone(this AnalyticsSourceGivingUnit source, bool deepCopy)
 {
     if (deepCopy)
     {
         return(source.Clone() as AnalyticsSourceGivingUnit);
     }
     else
     {
         var target = new AnalyticsSourceGivingUnit();
         target.CopyPropertiesFrom(source);
         return(target);
     }
 }
        /// <summary>
        /// Clones this AnalyticsSourceGivingUnit object to a new AnalyticsSourceGivingUnit object with default values for the properties in the Entity and Model base classes.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <returns></returns>
        public static AnalyticsSourceGivingUnit CloneWithoutIdentity(this AnalyticsSourceGivingUnit source)
        {
            var target = new AnalyticsSourceGivingUnit();

            target.CopyPropertiesFrom(source);

            target.Id          = 0;
            target.Guid        = Guid.NewGuid();
            target.ForeignKey  = null;
            target.ForeignId   = null;
            target.ForeignGuid = null;

            return(target);
        }
 /// <summary>
 /// Copies the properties from another AnalyticsSourceGivingUnit object to this AnalyticsSourceGivingUnit object
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="source">The source.</param>
 public static void CopyPropertiesFrom(this AnalyticsSourceGivingUnit target, AnalyticsSourceGivingUnit source)
 {
     target.Id                = source.Id;
     target.ForeignGuid       = source.ForeignGuid;
     target.ForeignKey        = source.ForeignKey;
     target.Frequency         = source.Frequency;
     target.GiftAmountIqr     = source.GiftAmountIqr;
     target.GiftAmountMedian  = source.GiftAmountMedian;
     target.GiftFrequencyMean = source.GiftFrequencyMean;
     target.GiftFrequencyStandardDeviation = source.GiftFrequencyStandardDeviation;
     target.GivingBin                = source.GivingBin;
     target.GivingId                 = source.GivingId;
     target.GivingLeaderPersonId     = source.GivingLeaderPersonId;
     target.GivingPercentile         = source.GivingPercentile;
     target.GivingSalutation         = source.GivingSalutation;
     target.GivingSalutationFull     = source.GivingSalutationFull;
     target.PercentGiftsScheduled    = source.PercentGiftsScheduled;
     target.PreferredCurrency        = source.PreferredCurrency;
     target.PreferredCurrencyValueId = source.PreferredCurrencyValueId;
     target.PreferredSource          = source.PreferredSource;
     target.PreferredSourceValueId   = source.PreferredSourceValueId;
     target.Guid      = source.Guid;
     target.ForeignId = source.ForeignId;
 }