Affecto.IdentityManagement.Store.EntityFramework.Queries.UserByIdQuery.Execute C# (CSharp) Метод

Execute() публичный Метод

public Execute ( System.Guid userId ) : User
userId System.Guid
Результат User
        public User Execute(Guid userId)
        {
            return queryBuilder.IncludeAll()
                .SingleOrDefault(u => u.Id == userId);
        }

Usage Example

        public User GetUser(Guid id)
        {
            var query = new UserByIdQuery(dbContext.Users);
            var user = query.Execute(id);

            if (user == null)
            {
                throw new EntityNotFoundException("User", id);
            }

            return user;
        }
All Usage Examples Of Affecto.IdentityManagement.Store.EntityFramework.Queries.UserByIdQuery::Execute