Strange assignment to local variable in profilecontroller.cs edit methods

Dec 31, 2011 at 1:13 AM


I've recently been working with the project silk code base and noticed a strange local variable assignment in the MileageStats.Web.Controllers.ProfileController.cs class: the MileageStats.Domain.Models.User function argument "updatedUser" in "Edit", "JsonEdit" and "CompleteRegistration" is assigned to a local variable ("user") before being used in a view or JSON construct.

I feel I must be missing something as I cannot see a reason for this, in either the code logic or for variable scoping purposes.

Is there an implicit reason for this or something other reason, i.e. best practise?

Many thanks in advance,


Jan 2, 2012 at 5:19 PM
Edited Jan 2, 2012 at 5:46 PM


Based on my understanding, this was done to add clarity to the code. However, if you believe this should be changed you could create a work item in the Issue Tracker so that the team is aware of it and might consider it for a future release.


Agustin Adami

Jan 4, 2012 at 11:17 PM

Yes, I agree it is strange. It may have been done for clarity as Agustin suggested, but it's more likely it was left over from a previous refactoring and was just overlooked. I don't think it represents any best practice or serves any particular purpose. I'll add it to the issue tracker so we can clean it up in a future revision.

Thanks for pointing it out,

Jan 4, 2012 at 11:18 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.