Example #1
0
 /// <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());
Example #2
0
 /// <inheritdoc />
 public Task <IEnumerable <GetAllUsersQuery.User> > Handle(
     GetAllUsersQuery request,
     CancellationToken cancellationToken)
 => Task.FromResult(_database.Query <GetAllUsersQuery.User>().AsEnumerable());