Orchard Templates

Topics: General, Writing modules
May 8, 2014 at 10:15 AM
Is it possible to access the workcontext in Templates?

e.g.

@{
var userId = WorkContext.CurrentUser.Id;
}
You are @userId
May 8, 2014 at 3:16 PM
as i know, we can get user name, so id is also ok, i think
May 8, 2014 at 7:42 PM
Edited May 8, 2014 at 7:42 PM
You can use this:

var services = WorkContext.Resolve<IAuthenticationService>();
var cuser = services.GetAuthenticatedUser();