public T GetUser <T>() where T : class { if (UserId == null) { return(null); } return(SecurityProvider.GetPermissionAsync(UserId).Result as T); }
public bool IsInDynamicRole(object role) { if (UserId != null) { var permission = SecurityProvider.GetPermissionAsync(UserId).Result; return(permission.IsInRole(role)); } return(false); }
public Task <T> GetUserAsync <T>() where T : class { return(SecurityProvider.GetPermissionAsync(UserId).ContinueWith(t => t.Result as T)); }