Subsonic 3 using User.Identity.Name versus Environment.Username for Audit Fields

subsonicsubsonic3

Using Subsonic v3.0.0.3 and seems the Update() and Add() methods are using the Environment.Username for the ModifiedBy and CreatedBy fields.

What would be the best way for me to get this to use the MVC/Asp.net User.Identity.Username as there are many 'Bob' names in our user collection and currently having a new record created with CreatedBy = 'Bob' is not as helpful as CreatedBy = 'bsmith'

Thanks!

Best Answer

Could you edit the ActiveRecord.tt template file and replace all instances of

Environment.Username 

with this?

HttpContext.Current.User.Identity.Username
Related Topic