Dim project = new Project(1)
Dim tasks = Task.GetTasks()
Return <?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/project">
<Name><%= project.name %></Name>
<Tasks>
<%= tasks.Select(Function(t) _
<Task>
<ID><%= tasks.IndexOf(t) + 1 %></ID>
</Task> _
) %>
</Tasks>
</Project>
I am trying to replace tasks.IndexOf(t) + 1 with something a little simpler. Is there any built in functionality for this?
Hrmm xml literals do not seem to translate well on here….
There’s an overload for
Enumerable.Selectthat supports passing an index along with the object itself. You can use that one: