codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.46k stars 1.09k forks source link

Documentation issue: URLs #457

Closed rmrpeters closed 1 year ago

rmrpeters commented 1 year ago

Hi, I found a bug in the documentation sample for encoding a URL.

line string payload = generator.ToString();

should be:-

string payload = generator.Value;

codebude commented 1 year ago

Hm have you seen that it's the url class from QRCoder and not the standard from .NET. Have a look here: https://github.com/codebude/QRCoder/blob/dd35a3b09f5920721af080b031e42ca123c8b09a/QRCoder/PayloadGenerator.cs#LL309C1-L309C1

So ToString() should still be the correct method as all payload generators inherit from Payload class and must implement ToString().