/// <inheritdoc /> public Task<IEnumerable<GetAllUsersQuery.User>> Handle( GetAllUsersQuery request, CancellationToken cancellationToken) => Task.FromResult(_database.Query<GetAllUsersQuery.User>() .Select("Users.id", "Users.FirstName", "Users.LastName", "Users.Email", "permissions.value as Permissions") .From("Permissions INNER JOIN Users ON (Permissions.UserId = Users.Id) ") .Where($"Permissions.organizationId = {request.OrganizationId} AND Permissions.PermissionKey = {PermissionsHelper.Claims.UserRole} ") .AsEnumerable());
/// <inheritdoc /> public Task <IEnumerable <GetAllUsersQuery.User> > Handle( GetAllUsersQuery request, CancellationToken cancellationToken) => Task.FromResult(_database.Query <GetAllUsersQuery.User>().AsEnumerable());