eliminates region sections

This commit is contained in:
BinaryAlley committed 2024-10-12 22:03:57 +03:00
1 parent 705c02b90d
commit 405fc1ff9a
370 files changed
+47 -1618

No files matched your search

@@ -18,12 +18,9 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetDirector
/// </summary>
public class GetDirectoriesQueryHandler : IRequestHandler<GetDirectoriesQuery, ErrorOr<IEnumerable<DirectoryResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IDirectoryService _directoryService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoriesQueryHandler"/> class.
/// </summary>
@@ -34,9 +31,7 @@ public class GetDirectoriesQueryHandler : IRequestHandler<GetDirectoriesQuery, E
_directoryService = directoryService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the list of directories at the specified path.
/// </summary>
@@ -50,5 +45,4 @@ public class GetDirectoriesQueryHandler : IRequestHandler<GetDirectoriesQuery, E
ErrorOr<IEnumerable<Directory>> result = _directoryService.GetSubdirectories(request.Path, request.IncludeHiddenElements);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<DirectoryResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetDirector
/// </summary>
public class GetDirectoriesQueryValidator : AbstractValidator<GetDirectoriesQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoriesQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetDirectoriesQueryValidator : AbstractValidator<GetDirectoriesQuer
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -21,14 +21,11 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetDirector
/// </summary>
public class GetDirectoryTreeQueryHandler : IRequestHandler<GetDirectoryTreeQuery, ErrorOr<IEnumerable<FileSystemTreeNodeResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IDirectoryService _directoryService;
private readonly IFileService _fileService;
private readonly IPathService _pathService;
private readonly IDriveService _driveService;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoryTreeQueryHandler"/> class.
/// </summary>
@@ -43,9 +40,7 @@ public class GetDirectoryTreeQueryHandler : IRequestHandler<GetDirectoryTreeQuer
_pathService = pathService;
_driveService = driveService;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the tree of expanded directories leading up to the requested path, with the additional list of drives, and children of the last child directory.
/// </summary>
@@ -182,5 +177,4 @@ public class GetDirectoryTreeQueryHandler : IRequestHandler<GetDirectoryTreeQuer
node.ChildrenLoaded = true;
return Result.Success;
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetDirector
/// </summary>
public class GetDirectoryTreeQueryValidator : AbstractValidator<GetDirectoryTreeQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoryTreeQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetDirectoryTreeQueryValidator : AbstractValidator<GetDirectoryTree
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetTreeDire
/// </summary>
public class GetTreeDirectoriesQueryHandler : IRequestHandler<GetTreeDirectoriesQuery, ErrorOr<IEnumerable<FileSystemTreeNodeResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IDirectoryService _directoryService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeDirectoriesQueryHandler"/> class.
/// </summary>
@@ -34,9 +31,7 @@ public class GetTreeDirectoriesQueryHandler : IRequestHandler<GetTreeDirectories
_directoryService = directoryService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the list of directories at the specified path.
/// </summary>
@@ -50,5 +45,4 @@ public class GetTreeDirectoriesQueryHandler : IRequestHandler<GetTreeDirectories
ErrorOr<IEnumerable<Directory>> result = _directoryService.GetSubdirectories(request.Path, request.IncludeHiddenElements);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<FileSystemTreeNodeResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Directories.Queries.GetTreeDire
/// </summary>
public class GetTreeDirectoriesQueryValidator : AbstractValidator<GetTreeDirectoriesQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeDirectoriesQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetTreeDirectoriesQueryValidator : AbstractValidator<GetTreeDirecto
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.Core.FileManagement.Drives.Queries.GetDrives;
/// </summary>
public class GetDrivesQueryHandler : IRequestHandler<GetDrivesQuery, ErrorOr<IEnumerable<FileSystemTreeNodeResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IDriveService _driveService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDrivesQueryHandler"/> class.
/// </summary>
@@ -34,9 +31,7 @@ public class GetDrivesQueryHandler : IRequestHandler<GetDrivesQuery, ErrorOr<IEn
_driveService = driveService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the list of file system drives.
/// </summary>
@@ -50,5 +45,4 @@ public class GetDrivesQueryHandler : IRequestHandler<GetDrivesQuery, ErrorOr<IEn
ErrorOr<IEnumerable<FileSystemItem>> result = _driveService.GetDrives();
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<FileSystemTreeNodeResponse>>(values)), errors => errors));
}
#endregion
}
@@ -13,11 +13,8 @@ namespace Lumina.Application.Core.FileManagement.FileSystem.Queries.GetFileSyste
/// </summary>
public class GetFileSystemQueryHandler : IRequestHandler<GetFileSystemQuery, FileSystemTypeResponse>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPlatformContext _platformContext;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFileSystemQueryHandler"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetFileSystemQueryHandler : IRequestHandler<GetFileSystemQuery, Fil
{
_platformContext = platformContextManager.GetCurrentContext();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the type of the file system.
/// </summary>
@@ -39,5 +34,4 @@ public class GetFileSystemQueryHandler : IRequestHandler<GetFileSystemQuery, Fil
{
return ValueTask.FromResult(new FileSystemTypeResponse(_platformContext.Platform));
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.Core.FileManagement.Files.Queries.GetFiles;
/// </summary>
public class GetFilesQueryHandler : IRequestHandler<GetFilesQuery, ErrorOr<IEnumerable<FileResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFileService _fileService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFilesQueryHandler"/> class.
/// </summary>
@@ -34,9 +31,7 @@ public class GetFilesQueryHandler : IRequestHandler<GetFilesQuery, ErrorOr<IEnum
_fileService = fileService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the list of files at the specified path.
/// </summary>
@@ -50,5 +45,4 @@ public class GetFilesQueryHandler : IRequestHandler<GetFilesQuery, ErrorOr<IEnum
ErrorOr<IEnumerable<File>> result = _fileService.GetFiles(request.Path, request.IncludeHiddenElements);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<FileResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Files.Queries.GetFiles;
/// </summary>
public class GetFilesQueryValidator : AbstractValidator<GetFilesQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFilesQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetFilesQueryValidator : AbstractValidator<GetFilesQuery>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.Core.FileManagement.Files.Queries.GetTreeFiles;
/// </summary>
public class GetTreeFilesQueryHandler : IRequestHandler<GetTreeFilesQuery, ErrorOr<IEnumerable<FileSystemTreeNodeResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFileService _fileService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeFilesQueryHandler"/> class.
/// </summary>
@@ -34,9 +31,7 @@ public class GetTreeFilesQueryHandler : IRequestHandler<GetTreeFilesQuery, Error
_fileService = fileService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the list of files at the specified path.
/// </summary>
@@ -50,5 +45,4 @@ public class GetTreeFilesQueryHandler : IRequestHandler<GetTreeFilesQuery, Error
ErrorOr<IEnumerable<File>> result = _fileService.GetFiles(request.Path, request.IncludeHiddenElements);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<FileSystemTreeNodeResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Files.Queries.GetTreeFiles;
/// </summary>
public class GetTreeFilesQueryValidator : AbstractValidator<GetTreeFilesQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeFilesQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetTreeFilesQueryValidator : AbstractValidator<GetTreeFilesQuery>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -15,11 +15,8 @@ namespace Lumina.Application.Core.FileManagement.Paths.Commands.CombinePath;
/// </summary>
public class CombinePathCommandHandler : IRequestHandler<CombinePathCommand, ErrorOr<PathSegmentResponse>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="SplitPathCommandHandler"/> class.
/// </summary>
@@ -28,9 +25,7 @@ public class CombinePathCommandHandler : IRequestHandler<CombinePathCommand, Err
{
_pathService = pathService;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Combines two file system paths.
/// </summary>
@@ -44,5 +39,4 @@ public class CombinePathCommandHandler : IRequestHandler<CombinePathCommand, Err
ErrorOr<string> result = _pathService.CombinePath(request.OriginalPath, request.NewPath);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(new PathSegmentResponse(result.Value)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Commands.CombinePath;
/// </summary>
public class CombinePathCommandValidator : AbstractValidator<CombinePathCommand>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CombinePathCommandValidator"/> class.
/// </summary>
@@ -19,5 +18,4 @@ public class CombinePathCommandValidator : AbstractValidator<CombinePathCommand>
RuleFor(x => x.OriginalPath).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
RuleFor(x => x.NewPath).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -17,12 +17,9 @@ namespace Lumina.Application.Core.FileManagement.Paths.Commands.SplitPath;
/// </summary>
public class SplitPathCommandHandler : IRequestHandler<SplitPathCommand, ErrorOr<IEnumerable<PathSegmentResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="SplitPathCommandHandler"/> class.
/// </summary>
@@ -33,9 +30,7 @@ public class SplitPathCommandHandler : IRequestHandler<SplitPathCommand, ErrorOr
_pathService = pathService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the path components of the specified path.
/// </summary>
@@ -49,5 +44,4 @@ public class SplitPathCommandHandler : IRequestHandler<SplitPathCommand, ErrorOr
ErrorOr<IEnumerable<PathSegment>> result = _pathService.ParsePath(request.Path);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<PathSegmentResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Commands.SplitPath;
/// </summary>
public class SplitPathCommandValidator : AbstractValidator<SplitPathCommand>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="SplitPathCommandValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class SplitPathCommandValidator : AbstractValidator<SplitPathCommand>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -13,11 +13,8 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.CheckPathExists;
/// </summary>
public class CheckPathExistsQueryHandler : IRequestHandler<CheckPathExistsQuery, PathExistsResponse>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CheckPathExistsQueryHandler"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class CheckPathExistsQueryHandler : IRequestHandler<CheckPathExistsQuery,
{
_pathService = pathService;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Checks the existence of the specified file system path.
/// </summary>
@@ -41,5 +36,4 @@ public class CheckPathExistsQueryHandler : IRequestHandler<CheckPathExistsQuery,
{
return ValueTask.FromResult(new PathExistsResponse(_pathService.Exists(request.Path, request.IncludeHiddenElements)));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.CheckPathExists;
/// </summary>
public class CheckPathExistsQueryValidator : AbstractValidator<CheckPathExistsQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CheckPathExistsQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class CheckPathExistsQueryValidator : AbstractValidator<CheckPathExistsQu
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -17,12 +17,9 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.GetPathParent;
/// </summary>
public class GetPathParentQueryHandler : IRequestHandler<GetPathParentQuery, ErrorOr<IEnumerable<PathSegmentResponse>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathParentQueryHandler"/> class.
/// </summary>
@@ -33,9 +30,7 @@ public class GetPathParentQueryHandler : IRequestHandler<GetPathParentQuery, Err
_pathService = pathService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the parent of the specified file system path.
/// </summary>
@@ -49,5 +44,4 @@ public class GetPathParentQueryHandler : IRequestHandler<GetPathParentQuery, Err
ErrorOr<IEnumerable<PathSegment>> result = _pathService.GoUpOneLevel(request.Path);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<IEnumerable<PathSegmentResponse>>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.GetPathParent;
/// </summary>
public class GetPathParentQueryValidator : AbstractValidator<GetPathParentQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathParentQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetPathParentQueryValidator : AbstractValidator<GetPathParentQuery>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -16,12 +16,9 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.GetPathRoot;
/// </summary>
public class GetPathRootQueryHandler : IRequestHandler<GetPathRootQuery, ErrorOr<PathSegmentResponse>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathRootQueryHandler"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class GetPathRootQueryHandler : IRequestHandler<GetPathRootQuery, ErrorOr
_pathService = pathService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the root of the specified file system path.
/// </summary>
@@ -46,5 +41,4 @@ public class GetPathRootQueryHandler : IRequestHandler<GetPathRootQuery, ErrorOr
ErrorOr<PathSegment> result = _pathService.GetPathRoot(request.Path);
return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<PathSegmentResponse>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.GetPathRoot;
/// </summary>
public class GetPathRootQueryValidator : AbstractValidator<GetPathRootQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathRootQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class GetPathRootQueryValidator : AbstractValidator<GetPathRootQuery>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -13,11 +13,8 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.GetPathSeparator;
/// </summary>
public class GetPathSeparatorQueryHandler : IRequestHandler<GetPathSeparatorQuery, PathSeparatorResponse>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathSeparatorQueryHandler"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetPathSeparatorQueryHandler : IRequestHandler<GetPathSeparatorQuer
{
_pathService = pathService;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the path separator character of a file system path.
/// </summary>
@@ -39,5 +34,4 @@ public class GetPathSeparatorQueryHandler : IRequestHandler<GetPathSeparatorQuer
{
return ValueTask.FromResult(new PathSeparatorResponse(_pathService.PathSeparator.ToString()));
}
#endregion
}
@@ -13,11 +13,8 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.ValidatePath;
/// </summary>
public class ValidatePathQueryHandler : IRequestHandler<ValidatePathQuery, PathValidResponse>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _pathService;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ValidatePathQueryHandler"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class ValidatePathQueryHandler : IRequestHandler<ValidatePathQuery, PathV
{
_pathService = pathService;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Validates the specified file system path.
/// </summary>
@@ -41,5 +36,4 @@ public class ValidatePathQueryHandler : IRequestHandler<ValidatePathQuery, PathV
{
return ValueTask.FromResult(new PathValidResponse(_pathService.IsValidPath(request.Path)));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Paths.Queries.ValidatePath;
/// </summary>
public class ValidatePathQueryValidator : AbstractValidator<ValidatePathQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ValidatePathQueryValidator"/> class.
/// </summary>
@@ -18,5 +17,4 @@ public class ValidatePathQueryValidator : AbstractValidator<ValidatePathQuery>
{
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
}
#endregion
}
@@ -16,12 +16,9 @@ namespace Lumina.Application.Core.FileManagement.Thumbnails.Queries.GetThumbnail
/// </summary>
public class GetThumbnailQueryHandler : IRequestHandler<GetThumbnailQuery, ErrorOr<ThumbnailResponse>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IThumbnailService _thumbnailsService;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetThumbnailQueryHandler"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class GetThumbnailQueryHandler : IRequestHandler<GetThumbnailQuery, Error
_thumbnailsService = thumbnailsService;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the thumbnail for a file located at the specified path, with the specified quality.
/// </summary>
@@ -46,5 +41,4 @@ public class GetThumbnailQueryHandler : IRequestHandler<GetThumbnailQuery, Error
ErrorOr<Thumbnail> result = await _thumbnailsService.GetThumbnailAsync(request.Path, request.Quality, cancellationToken);
return await ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(_mapper.Map<ThumbnailResponse>(values)), errors => errors));
}
#endregion
}
@@ -10,7 +10,6 @@ namespace Lumina.Application.Core.FileManagement.Thumbnails.Queries.GetThumbnail
/// </summary>
public class GetThumbnailQueryValidator : AbstractValidator<GetThumbnailQuery>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetThumbnailQueryValidator"/> class.
/// </summary>
@@ -19,5 +18,4 @@ public class GetThumbnailQueryValidator : AbstractValidator<GetThumbnailQuery>
RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
RuleFor(x => x.Quality).InclusiveBetween(0, 100).WithMessage(Errors.Thumbnails.ImageQaulityMustBeBetweenZeroAndOneHundred.Code);
}
#endregion
}
@@ -27,12 +27,9 @@ namespace Lumina.Application.Core.WrittenContentLibrary.BooksLibrary.Books.Comma
/// </summary>
public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Book>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IUnitOfWork _unitOfWork;
private readonly IMapper _mapper;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandHandler"/> class.
/// </summary>
@@ -43,9 +40,7 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
_unitOfWork = unitOfWork;
_mapper = mapper;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Handles the command to add a book.
/// </summary>
@@ -176,5 +171,4 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
return createBookResult.Value;
}
#endregion
}
@@ -11,7 +11,6 @@ namespace Lumina.Application.Core.WrittenContentLibrary.BooksLibrary.Books.Comma
/// </summary>
public class AddBookCommandValidator : AbstractValidator<AddBookCommand>
{
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandValidator"/> class.
/// </summary>
@@ -211,5 +210,4 @@ public class AddBookCommandValidator : AbstractValidator<AddBookCommand>
.WithMessage(Errors.Metadata.RatingVoteCountMustBePositive.Code);
});
}
#endregion
}
@@ -18,11 +18,8 @@ namespace Lumina.Application.Core.WrittenContentLibrary.BooksLibrary.Books.Queri
/// </summary>
public class GetBooksQueryHandler : IRequestHandler<GetBooksQuery, ErrorOr<IEnumerable<Book>>>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IUnitOfWork _unitOfWork;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetBooksQueryHandler"/> class.
/// </summary>
@@ -31,9 +28,7 @@ public class GetBooksQueryHandler : IRequestHandler<GetBooksQuery, ErrorOr<IEnum
{
_unitOfWork = unitOfWork;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Handles the query to get all books.
/// </summary>
@@ -48,5 +43,4 @@ public class GetBooksQueryHandler : IRequestHandler<GetBooksQuery, ErrorOr<IEnum
ErrorOr<IEnumerable<BookModel>> getBooksResult = await bookRepository.GetAllAsync(cancellationToken).ConfigureAwait(false);
return getBooksResult.Match(values => ErrorOrFactory.From(values.Adapt<IEnumerable<Book>>()), errors => errors);
}
#endregion
}