Esempio n. 1
0
 /// <summary>
 /// Copies the properties from another PersistedDataset object to this PersistedDataset object
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="source">The source.</param>
 public static void CopyPropertiesFrom(this PersistedDataset target, PersistedDataset source)
 {
     target.Id                     = source.Id;
     target.AccessKey              = source.AccessKey;
     target.AllowManualRefresh     = source.AllowManualRefresh;
     target.BuildScript            = source.BuildScript;
     target.BuildScriptType        = source.BuildScriptType;
     target.Description            = source.Description;
     target.EnabledLavaCommands    = source.EnabledLavaCommands;
     target.EntityTypeId           = source.EntityTypeId;
     target.ExpireDateTime         = source.ExpireDateTime;
     target.ForeignGuid            = source.ForeignGuid;
     target.ForeignKey             = source.ForeignKey;
     target.IsActive               = source.IsActive;
     target.IsSystem               = source.IsSystem;
     target.LastRefreshDateTime    = source.LastRefreshDateTime;
     target.MemoryCacheDurationMS  = source.MemoryCacheDurationMS;
     target.Name                   = source.Name;
     target.RefreshIntervalMinutes = source.RefreshIntervalMinutes;
     target.ResultData             = source.ResultData;
     target.ResultFormat           = source.ResultFormat;
     target.TimeToBuildMS          = source.TimeToBuildMS;
     target.Guid                   = source.Guid;
     target.ForeignId              = source.ForeignId;
 }
Esempio n. 2
0
 /// <summary>
 /// Clones this PersistedDataset object to a new PersistedDataset 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 PersistedDataset Clone(this PersistedDataset source, bool deepCopy)
 {
     if (deepCopy)
     {
         return(source.Clone() as PersistedDataset);
     }
     else
     {
         var target = new PersistedDataset();
         target.CopyPropertiesFrom(source);
         return(target);
     }
 }
        /// <summary>
        /// Clones this PersistedDataset object to a new PersistedDataset 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 PersistedDataset CloneWithoutIdentity(this PersistedDataset source)
        {
            var target = new PersistedDataset();

            target.CopyPropertiesFrom(source);

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

            return(target);
        }