public AdminController(IUnitOfWork unitOfWork, IMapper mapper, UserManager <AppUser> userManager, IFileRepoService fileRepoService)
 {
     this.fileRepoService = fileRepoService;
     this.mapper          = mapper;
     this.userManager     = userManager;
     this.unitOfWork      = unitOfWork;
 }
示例#2
0
 public CoursesController(IUnitOfWork unitOfWork, IMapper mapper, IPhotoService photoService, IFileRepoService fileRepoService, DataContext context)
 {
     this.context         = context;
     this.fileRepoService = fileRepoService;
     this.photoService    = photoService;
     this.mapper          = mapper;
     this.unitOfWork      = unitOfWork;
 }
示例#3
0
 //public UsersController(DataContext context)
 public UsersController(IUnitOfWork unitOfWork, IMapper mapper, IPhotoService photoService, IFileRepoService fileRepoService, DataContext context, IAccountService accountService)
 //public UsersController(IunitOfWork.UserRepository unitOfWork.UserRepository, IMapper mapper, IPhotoService photoService)
 {
     this.unitOfWork      = unitOfWork;
     this.mapper          = mapper;
     this.photoService    = photoService;
     this.fileRepoService = fileRepoService;
     this._context        = context;
     this.accountService  = accountService;
 }
        public EnrichMetadataTransformBlock(
            IFileRepoService sourceFileRepoService,
            IImageMetadataProviderService imageMetadataProviderService,
            IFilePathMetadataExtractService filePathMetadataExtractService)
        {
            _sourceFileRepoService          = sourceFileRepoService;
            _imageMetadataProviderService   = imageMetadataProviderService;
            _filePathMetadataExtractService = filePathMetadataExtractService;

            Block = new TransformBlock <PipelineItem, PipelineItem>(EnrichPipeLineWithMetadata);
        }
示例#5
0
        public CopyFileBlock(IPipelineContext context, IFileRepoService fileRepo, ITargetPathResolver targetPathResolver)
        {
            Block = new ActionBlock <PipelineItem>(async pipelineItem =>
            {
                var desDirPath = targetPathResolver.ResolveTargetDirPath(
                    context.TargetDir.FullName, pipelineItem.Descriptor,
                    pipelineItem.FilePathMetadataInfo, pipelineItem.ImageMetaData);

                if (!Directory.Exists(desDirPath))
                {
                    Directory.CreateDirectory(desDirPath);
                }

                var desFilePath = Path.Combine(desDirPath, targetPathResolver.ResolveFileName(
                                                   context.TargetDir.FullName, pipelineItem.Descriptor, pipelineItem.ImageMetaData));

                if (fileRepo.FileExists(desFilePath))
                {
                    // Log Warning & auto rename the file
                    var origExt = pipelineItem.Descriptor.Ext;
                    var newExt  = $"{pipelineItem.Hash.ToString("N")[^12..]}{origExt}";
        public CalculateFileHashTransformBlock(IFileRepoService sourceFileRepoService)
        {
            _sourceFileRepoService = sourceFileRepoService;

            Block = new TransformBlock <PipelineItem, PipelineItem>(CalculateAndTransform);
        }
示例#7
0
        public EnumerateSourceFilesTransformToManyBlock(IFileRepoService sourceFileRepoService)
        {
            _sourceFileRepoService = sourceFileRepoService;

            Block = new TransformManyBlock <DirectoryInfo, PipelineItem>(Transform);
        }