public async Task <bool> AddCustomerReference(MemberStorageItem item, string fileName, byte[] fileData)
        {
            var uploadTask = await _blobClient.UploadFileToBlobAsync(fileName, fileData);

            item.FileUri = uploadTask;
            await _dataStoreRepository.AddCustomerReferenceAsync(_factory.Convert(item));

            return(true);
        }
        // POST api/<DocumentStorage>
        public async Task <IActionResult> PostAsync(IFormFile formFile, [FromForm] MemberStorageItem item)
        {
            if (formFile.Length > 0)
            {
                var filePath = Path.GetTempFileName();

                using (var stream = System.IO.File.Create(filePath))
                {
                    await formFile.CopyToAsync(stream);
                }
            }
            string mimeType = formFile.ContentType;

            byte[] fileData = new byte[formFile.Length];
            await _documentStorageService.AddCustomerReference(item, formFile.FileName, fileData);

            return(NoContent());
        }
        public MemberDocumentStorage Convert(MemberStorageItem entity)
        {
            var mapper = new Mapper(_config);

            return(mapper.Map <MemberDocumentStorage>(entity));
        }