Skip to content

Commit

Permalink
optimize culture info
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Venclovas authored and Kevin Venclovas committed Oct 10, 2023
1 parent e7e84db commit 6082eae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/FikaAmazonAPI/AmazonConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using FikaAmazonAPI.Services;
using FikaAmazonAPI.Utils;
using System;
using System.Globalization;
using System.Threading;

namespace FikaAmazonAPI
{
Expand Down Expand Up @@ -84,10 +86,11 @@ public class AmazonConnection
private UnauthorizedAccessException _NoCredentials = new UnauthorizedAccessException($"Error, you cannot make calls to Amazon without credentials!");

public string RefNumber { get; set; }
public AmazonConnection(AmazonCredential Credentials, string RefNumber = null)
public AmazonConnection(AmazonCredential Credentials, string RefNumber = null, CultureInfo? cultureInfo = null)

Check warning on line 89 in Source/FikaAmazonAPI/AmazonConnection.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
this.Authenticate(Credentials);
this.RefNumber = RefNumber;
Thread.CurrentThread.CurrentCulture = cultureInfo ?? CultureInfo.InvariantCulture;
}

private void Authenticate(AmazonCredential Credentials)
Expand Down

0 comments on commit 6082eae

Please sign in to comment.