public async Task <ListingImage> AddImage(Guid listingId, byte[] imageContent, string imageMediaType)
        {
            if (imageContent == null)
            {
                throw new ArgumentNullException(nameof(imageContent));
            }
            if (string.IsNullOrWhiteSpace(imageMediaType))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(imageMediaType));
            }

            var listing = await _findListingCoordinator.Find(listingId);

            if (listing == null)
            {
                return(null);
            }

            var imageFileName = $"{Guid.NewGuid()}";
            var url           = await _imageStore.PersistArticleEntryMedia(imageFileName, imageContent, imageMediaType);

            var image = new ListingImage()
            {
                Listing   = listing,
                ListingId = listingId,
                Url       = url
            };

            await _dbContext.Add(image);

            await _dbContext.SaveChanges();

            return(image);
        }
        public async Task <Listing> Create(EditListingRequest newListing)
        {
            if (newListing == null)
            {
                throw new ArgumentNullException(nameof(newListing));
            }

            var listing = new Listing();

            listing.Update(newListing);

            if (!_validationHelper.HasValidFields(listing))
            {
                return(null);
            }

            await _dbContext.Add(listing);

            await _dbContext.SaveChanges();

            return(listing);
        }