Thursday, 21 March 2013

Using RazorSharp page to create CSV list of TeamMentor users

One of the feature requests for the 3.3. release of TM was to have a CSV exported list of users (see Provided CSV of user accounts for Tom)

In the previous version of TM adding this feature would required a number of server-side+GUI code changes, or the use of ASPX pages (which I specifically didn't want to use).

But since 3.3 supports RazorSharp (*.cshtml files), we can now create such CSV export page just like this:

image

which can be accessed via TBot's run interface (note that the URL matches the name of the RazorSharp page):

image

And here is the best part!

If you look at this comment: Provided CSV of user accounts for Tom  , you will see that there is a bug in the display order, and that the the title field is missing.

This can be simply/quickly fixed like this:

image

Seen/tested in the browser without a full project compilation:

image

And since this all looks good, I just need to commit the changes to GitHub, which will trigger TeamCity's workflow, that will publish (after UnitTests execution) this version to the tests servers (this usually takes a couple minutes :)

I have to say that I really like the simplicity of Razor and the architecture I was able to create using RazorSharp