Ejemplo n.º 1
0
        /// <summary>
        /// Converts this instance of <see cref="Campus"/> to an instance of <see cref="CampusDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Campus"/> to convert.</param>
        public static CampusDTO ToDTO(this Campus entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new CampusDTO();

            dto.ID               = entity.ID;
            dto.Name             = entity.Name;
            dto.Address          = entity.Address;
            dto.Address2         = entity.Address2;
            dto.City             = entity.City;
            dto.ZipCode          = entity.ZipCode;
            dto.IsActive         = entity.IsActive;
            dto.CreatedByUserID  = entity.CreatedByUserID;
            dto.CreatedDate      = entity.CreatedDate;
            dto.ModifiedByUserID = entity.ModifiedByUserID;
            dto.ModifiedDate     = entity.ModifiedDate;
            entity.OnDTO(dto);

            return(dto);
        }