Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[release/9.0] Change usage of "Country" to "CountryRegion" #58280

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ public bool CanConvert(Type type, FormDataMapperOptions options)

// We are going to compile a function that maps all the properties for the type.
// Beware that the code below is not the actual exact code, just a simplification to understand what is happening at a high level.
// The general flow is as follows. For a type like Address { Street, City, Country, ZipCode }
// The general flow is as follows. For a type like Address { Street, City, CountryRegion, ZipCode }
// we will generate a function that looks like:
// public bool TryRead(ref FormDataReader reader, Type type, FormDataSerializerOptions options, out Address? result, out bool found)
// {
// bool foundProperty;
// bool succeeded = true;
// string street;
// string city;
// string country;
// string countryRegion;
// string zipCode;
// FormDataConveter<string> streetConverter;
// FormDataConveter<string> cityConverter;
// FormDataConveter<string> countryConverter;
// FormDataConveter<string> countryRegionConverter;
// FormDataConveter<string> zipCodeConverter;

// var streetConverter = options.ResolveConverter(typeof(string));
Expand All @@ -54,11 +54,11 @@ public bool CanConvert(Type type, FormDataMapperOptions options)
// found ||= foundProperty;
// reader.PopPrefix("City");
//
// var countryConverter = options.ResolveConverter(typeof(string));
// reader.PushPrefix("Country");
// succeeded &= countryConverter.TryRead(ref reader, typeof(string), options, out street, out foundProperty);
// var countryRegionConverter = options.ResolveConverter(typeof(string));
// reader.PushPrefix("CountryRegion");
// succeeded &= countryRegionConverter.TryRead(ref reader, typeof(string), options, out street, out foundProperty);
// found ||= foundProperty;
// reader.PopPrefix("Country");
// reader.PopPrefix("CountryRegion");
//
// var zipCodeConverter = options.ResolveConverter(typeof(string));
// reader.PushPrefix("ZipCode");
Expand All @@ -71,7 +71,7 @@ public bool CanConvert(Type type, FormDataMapperOptions options)
// result = new Address();
// result.Street = street;
// result.City = city;
// result.Country = country;
// result.CountryRegion = countryRegion;
// result.ZipCode = zipCode;
// }
// else
Expand Down
Loading