views:

140

answers:

1

Hi, 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!

+3  A: 

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

Environment.Username

with this?

HttpContext.Current.User.Identity.Username
GC