public async Task Handle(UpdateSupplierProfileNotification notification, CancellationToken cancellationToken)
        {
            var supplierProfile = await supplierProfileRepository.FindAsync(notification.UserId)
                                  .ConfigureAwait(false);

            if (supplierProfile == null)
            {
                throw new NotFoundException();
            }

            mapper.Map(notification, supplierProfile);

            if (!string.IsNullOrEmpty(notification.LogoFileName) && !notification.LogoFileBuffer.IsEmpty)
            {
                if (!string.IsNullOrEmpty(supplierProfile.Logo))
                {
                    await mediator.Publish(new DeleteFileNotification { FileName = supplierProfile.Logo });
                }

                supplierProfile.Logo = await mediator.Send(new SaveFileRequest { FileName = notification.LogoFileName, Buffer = notification.LogoFileBuffer });
            }

            var operationResult = await supplierProfileRepository.UpdateAsync(supplierProfile)
                                  .ConfigureAwait(false);

            if (operationResult.Status != OperationStatus.Successful)
            {
                throw new UpdateSupplierProfileException(operationResult);
            }
        }
        public async Task <SupplierPrivateProfileModel> Handle(GetPrivateSupplierProfileRequest request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                throw new ArgumentNullException($"{nameof(request)} of type {nameof(GetPrivateSupplierProfileRequest)} argument cannot be null.");
            }

            var supplierProfile = await supplierProfileRepository.FindAsync(request.UserId)
                                  .ConfigureAwait(false);

            if (supplierProfile == null)
            {
                throw new NotFoundException();
            }

            var supplierProfileModel = mapper.Map <SupplierPrivateProfileModel>(supplierProfile);

            if (!string.IsNullOrEmpty(supplierProfileModel.LogoUrl))
            {
                supplierProfileModel.LogoUrl = await mediator.Send(new GetFileUrlRequest { FileName = supplierProfileModel.LogoUrl });
            }

            return(supplierProfileModel);
        }