Ejemplo n.º 1
0
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static PersonViewed ToModel(this PersonViewedDto value)
        {
            PersonViewed result = new PersonViewed();

            value.CopyToModel(result);
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Copies the properties from another PersonViewed object to this PersonViewed object
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="source">The source.</param>
 public static void CopyPropertiesFrom(this PersonViewed target, PersonViewed source)
 {
     target.ViewerPersonId = source.ViewerPersonId;
     target.TargetPersonId = source.TargetPersonId;
     target.ViewDateTime   = source.ViewDateTime;
     target.IpAddress      = source.IpAddress;
     target.Source         = source.Source;
     target.Id             = source.Id;
     target.Guid           = source.Guid;
 }
 /// <summary>
 /// Clones this PersonViewed object to a new PersonViewed 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 PersonViewed Clone(this PersonViewed source, bool deepCopy)
 {
     if (deepCopy)
     {
         return(source.Clone() as PersonViewed);
     }
     else
     {
         var target = new PersonViewed();
         target.CopyPropertiesFrom(source);
         return(target);
     }
 }
        /// <summary>
        /// Clones this PersonViewed object to a new PersonViewed 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 PersonViewed CloneWithoutIdentity(this PersonViewed source)
        {
            var target = new PersonViewed();

            target.CopyPropertiesFrom(source);

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

            return(target);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Instantiates a new DTO object from the entity
 /// </summary>
 /// <param name="personViewed"></param>
 public PersonViewedDto(PersonViewed personViewed)
 {
     CopyFromModel(personViewed);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// To the dto.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public static PersonViewedDto ToDto(this PersonViewed value)
 {
     return(new PersonViewedDto(value));
 }