At the bottom of the image, we see a description. Since we don't have any general descriptions of the images from our upcoming image source, we need to create a generator that makes up descriptions. Here's how we would do it:
- Create a folder called Utils in the .NET Standard project.
- Create a new class called DescriptionGenerator in that folder.
- Add a using statement for System.Linq (using System.Linq;).
- Add the following code to the class:
public class DescriptionGenerator
{
private string[] _adjectives = { "nice", "horrible", "great",
"terribly old", "brand new" };
private string[] _other = { "picture of grandpa", "car", "photo
of a forest", "duck" };
private static Random random = new Random();
public string Generate()
{
var a = _adjectives[random.Next(_adjectives.Count())];
var...