/// <summary> /// Converts this instance of <see cref="UserRole"/> to an instance of <see cref="UserRoleDTO"/>. /// </summary> /// <param name="entity"><see cref="UserRole"/> to convert.</param> public static UserRoleDTO ToDTO(this UserRole entity) { if (entity == null) return null; var dto = new UserRoleDTO(); dto.UserRoleID = entity.UserRoleID; dto.UserID = entity.UserID; dto.RoleID = entity.RoleID; entity.OnDTO(dto); return dto; }
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="UserRoleDTO"/> converted from <see cref="UserRole"/>.</param> static partial void OnDTO(this UserRole entity, UserRoleDTO dto);