コード例 #1
0
        /// <summary>
        /// Converts this instance of <see cref="AssetType"/> to an instance of <see cref="AssetTypeDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="AssetType"/> to convert.</param>
        public static AssetTypeDTO ToDTO(this AssetType entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new AssetTypeDTO();

            dto.ID               = entity.ID;
            dto.Name             = entity.Name;
            dto.CreatedByUserID  = entity.CreatedByUserID;
            dto.CreatedDate      = entity.CreatedDate;
            dto.ModifiedByUserID = entity.ModifiedByUserID;
            dto.ModifiedDate     = entity.ModifiedDate;
            entity.OnDTO(dto);

            return(dto);
        }