avivbiton / BlizzardApiReader

.Net Core library to handle Blizzard public APIs
MIT License
35 stars 36 forks source link

Implement GetDefaultLocale #21

Closed linahanner closed 5 years ago

linahanner commented 5 years ago

Method GetDefaultLocale of class ApiConfiguration returns a hard-coded value regardless of the Region argument - implement method to return the right Locale for the right Region.

From testing towards Blizzard's API the default Locales for each Region appears to be:

avivbiton commented 5 years ago

I thought you already added that in your last pull request, is that right?

linahanner commented 5 years ago

Yes, that's right. Instead of implementing it as a method of ApiConfiguration it has been created as an Extension method of the Region enum.

avivbiton commented 5 years ago

@linahanner please take a look at the enumExtension.cs file. Porting to .net core removed the line that forced the generic to be an enum.
https://github.com/avivbiton/BlizzardApiReader/blob/master/BlizzardApiReader.Core/Extensions/EnumExtensions.cs
(On mobile. Sorry for formating)

linahanner commented 5 years ago

I'll have a look asap @avivbiton

linahanner commented 5 years ago

Check out the most recent pull request (#27)

The ability to specify the GenericType to an Enum requires an upgraded version of the C# language (7.3)

avivbiton commented 5 years ago

Thanks wasn't exactly sure if this feature is available in core