Example #1
0
 public forumSubcategoryDTO(Int64 idSubcategory, Nullable<Int64> idCategory, String title, String description, Nullable<DateTime> date, String ip, forumCategoryDTO forumCategory, List<forumPostDTO> forumPosts)
 {
     this.idSubcategory = idSubcategory;
     this.idCategory = idCategory;
     this.title = title;
     this.description = description;
     this.date = date;
     this.ip = ip;
     this.forumCategory = forumCategory;
     this.forumPosts = forumPosts;
 }
        /// <summary>
        /// Converts this instance of <see cref="forumCategory"/> to an instance of <see cref="forumCategoryDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="forumCategory"/> to convert.</param>
        public static forumCategoryDTO ToDTO(this forumCategory entity)
        {
            if (entity == null) return null;

            var dto = new forumCategoryDTO();

            dto.idCategory = entity.idCategory;
            dto.title = entity.title;
            dto.description = entity.description;
            dto.date = entity.date;
            dto.ip = entity.ip;

            entity.OnDTO(dto);

            return dto;
        }
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="forumCategoryDTO"/> converted from <see cref="forumCategory"/>.</param>
partial         static void OnDTO(this forumCategory entity, forumCategoryDTO dto);