I have a business logic layer and 2 applications which use this, a MVC UI and a Web API project.
One of the properties on my classes is CreatedBy and UpdatedBy, which should hold the userid.
public Nullable<System.DateTime> CreatedTS { get; set; }
public string CreatedBy { get; set; }
public Nullable<System.DateTime> UpdatedTS { get; set; }
public string UpdatedBy { get; set; }
Given there are multiple consumers of the BLL what is the best way to capture the userId?
A) - Set this within the BLL using Environment.UserName
?
B) - Ask the client to set it and use model data annotation to make this Required
C) - Ask the client to pass this into any Create or Update methods in the BLL.