I am trying to get the user that is using the application in the controller by doing this:
public class TableNameController : Controller
{
private ConnectionS
You cannot use field initializer for what you trying to do, but you can easily use instance constructor for that:
public class TableNameController : Controller
{
...
private string userIdentity;
public TableNameController() {
userIdentity = HttpContext.User.Identity.Name.Split('\\')[1].Replace(".", " ");
}
...