public static VocaDbUrl GetUrl(this IEntryImageUrlFactory persister, IEntryImageInformation picture, ImageSize size, bool checkExists) { if (checkExists && !persister.HasImage(picture, size)) { return(VocaDbUrl.Empty); } return(persister.GetUrl(picture, size)); }
public static VocaDbUrl GetUrlWithFallback(this IEntryImageUrlFactory urlFactory, IEntryImageInformation imageInfo, ImageSize size, VocaDbUrl fallbackUrl) { if (imageInfo == null || !imageInfo.ShouldExist() || !urlFactory.HasImage(imageInfo, size)) { return(fallbackUrl); } return(urlFactory.GetUrl(imageInfo, size)); }