public static PlaceOfBirth MapPlaceOfBirthFromProto(ProtoPlaceOfBirth placeOfBirth) { if (placeOfBirth == null) { return(null); } Country.List.TryGetValue(placeOfBirth.CountryOfBirth, out var country); DateTime.TryParseExact(placeOfBirth.Date, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var dateOfBirth); var proto = new PlaceOfBirth(dateOfBirth, placeOfBirth.CityOfBirth, country); return(proto); }
public static ProtoPlaceOfBirth MapPlaceOfBirthToProto(PlaceOfBirth placeOfBirth) { if (placeOfBirth == null) { return(null); } var proto = new ProtoPlaceOfBirth() { CityOfBirth = placeOfBirth.CityOfBirth, CountryOfBirth = placeOfBirth.CountryOfBirth.TwoLetterCode, Date = placeOfBirth.DateOfBirth.ToString("yyyyMMdd", CultureInfo.InvariantCulture) }; return(proto); }