/// <summary> /// Converts this instance of <see cref="forumPostDTO"/> to an instance of <see cref="forumPost"/>. /// </summary> /// <param name="dto"><see cref="forumPostDTO"/> to convert.</param> public static forumPost ToEntity(this forumPostDTO dto) { if (dto == null) return null; var entity = new forumPost(); entity.idForumPost = dto.idForumPost; entity.idSubcategory = dto.idSubcategory; entity.idPerson = dto.idPerson; entity.parent_post = dto.parent_post; entity.title = dto.title; entity.content_forum = dto.content_forum; entity.date = dto.date; entity.ip = dto.ip; dto.OnEntity(entity); return entity; }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="forumPost"/> converted from <see cref="forumPostDTO"/>.</param> partial static void OnEntity(this forumPostDTO dto, forumPost entity);