Implementation of Strategy Pattern (photo gallery example) I'm learning design patterns and I thought that it would be a good idea to make my examples of each pattern. This is my example of the Strategy Pattern. Can you tell me is it good and what to improve?

This is the Gallery class

    public class PhotoGallery
{
    private ICollection&lt;string&gt; photosNames;
    private IShareStrategy shareStrategy;


    public PhotoGallery()
    {
        this.photosNames = new List&lt;string&gt;();
    }


    public void AddPhoto(string photoName)
    {
        this.photosNames.Add(photoName);
    }

    private void SetShareStrategy(ShareStrategy strategy)
    {
        switch (strategy)
        {
            case ShareStrategy.onFacebook:
                this.shareStrategy = new ShareOnFacebook();
                break;
            case ShareStrategy.onInstagram:
                this.shareStrategy = new ShareOnInstagram();
                break;
            case ShareStrategy.onTwitter:
                this.shareStrategy = new ShareOnTwitter();
                break;
        }
    }

    public void SharePhoto(string photoName, ShareStrategy strategy)
    {
        if (!this.photosNames.Contains(photoName))
        {
            Console.WriteLine("Invalid photo name.");
            return;
        }

        this.SetShareStrategy(strategy);
        shareStrategy.Share(photoName);
    }
}


This is The Share Strategy Enum

public enum ShareStrategy
{
    onFacebook,
    onInstagram,
    onTwitter
}


And the Strategies classes

public class ShareOnFacebook : IShareStrategy
{
    public void Share(string photoName)
    {
        Console.WriteLine($"You shared {photoName} on Facebook.");
    }
}

public class ShareOnInstagram : IShareStrategy
{
    public void Share(string photoName)
    {
        Console.WriteLine($"You shared {photoName} on Instagram.");
    }
}

public class ShareOnTwitter : IShareStrategy
{
    public void Share(string photoName)
    {
        Console.WriteLine($"You shared {photoName} on Twitter.");
    }
}
I would use dependency injection. Something like

serviceCollection
   .AddTransient&lt;IShareStrategy, ShareOnFacebook&gt;()
   .AddTransient&lt;IShareStrategy, ShareOnTwitter&gt;()
   .AddTransient&lt;IShareStrategyProvider, ShareStrategyProvider&gt;();

public class ShareStrategyProvider : IShareStrategyProvider
{
   private readonly IEnumerable&lt;IShareStrategy&gt; _strategies;
   public ShareStrategyProvider(IEnumerable&lt;IShareStrategy&gt; strategies) 
   {
      _strategies = strategies;
   }

   public GetStrategy(ShareStrategy sharingStrategy);
   {
      return _strategies.Single(s =&gt; s.SharingStrategy == sharingStrategy);
   }
}


edit: Read up on open/closed principle, its related