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

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

            return(_queryExecutor.ExecuteAsync(userQuery, executionContext));
        }
Пример #2
0
        /// <summary>
        /// Finds a user by a database id returning a UserMicroSummary object if it
        /// is found, otherwise null.
        /// </summary>
        /// <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 <UserMicroSummary> GetUserMicroSummaryByIdAsync(int userId, IExecutionContext executionContext = null)
        {
            var query = new GetUserMicroSummaryByIdQuery(userId);

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }
        public Task <UserMicroSummary> AsMicroSummaryAsync()
        {
            var query = new GetUserMicroSummaryByIdQuery(_userId);

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }
Пример #4
0
        public IContentRepositoryQueryContext <UserMicroSummary> AsMicroSummary()
        {
            var query = new GetUserMicroSummaryByIdQuery(_userId);

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