public Task <UserDetails> ExecuteAsync(GetCurrentUserDetailsQuery query, IExecutionContext executionContext)
        {
            if (!executionContext.UserContext.UserId.HasValue)
            {
                return(null);
            }

            var userQuery = new GetUserDetailsByIdQuery(executionContext.UserContext.UserId.Value);

            return(_queryExecutor.ExecuteAsync(userQuery, executionContext));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Finds a user by a database id returning a UserDetails object if it
        /// is found, otherwise null.
        /// </summary>
        /// <param name="userId">The database id of the user to find.</param>
        /// <param name="executionContext">Optional execution context to use when executing the query. Useful if you need to temporarily elevate your permission level.</param>
        public Task <UserDetails> GetUserDetailsByIdAsync(int userId, IExecutionContext executionContext = null)
        {
            var query = new GetUserDetailsByIdQuery(userId);

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }
        public Task <UserDetails> AsDetailsAsync()
        {
            var query = new GetUserDetailsByIdQuery(_userId);

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }
Ejemplo n.º 4
0
        public IContentRepositoryQueryContext <UserDetails> AsDetails()
        {
            var query = new GetUserDetailsByIdQuery(_userId);

            return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }