Skip to content

Commit

Permalink
Country -> CountryRegion (#58280)
Browse files Browse the repository at this point in the history
Co-authored-by: wtgodbe <wigodbe@microsoft.com>
  • Loading branch information
github-actions[bot] and wtgodbe authored Oct 8, 2024
1 parent 1f554a9 commit 162d650
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 162d650

Please # to comment.