private static State MapState(IDataReader reader) { State p = new State(); int startingIndex = 0; p.StateProvinceId = reader.GetSafeInt32(startingIndex++); p.StateProvinceCode = reader.GetSafeString(startingIndex++); p.CountryRegionCode = reader.GetSafeString(startingIndex++); p.Name = reader.GetSafeString(startingIndex++); p.TerritoryId = reader.GetSafeInt32(startingIndex++); return p; }
public Address MapAddressDomain(IDataReader reader, int? startHere = null, bool ? use = false) { Address p = new Address(); State s = new State(); int startingIndex = startHere.HasValue ? startHere.Value : 0; //startingOrdinal p.Id = reader.GetSafeInt32(startingIndex++); p.Line1 = reader.GetSafeString(startingIndex++); p.Line2 = reader.GetSafeString(startingIndex++); p.City = reader.GetSafeString(startingIndex++); s.StateProvinceId = reader.GetSafeInt32(startingIndex++); s.StateProvinceCode = reader.GetSafeString(startingIndex++); s.CountryRegionCode = reader.GetSafeString(startingIndex++); s.Name = reader.GetSafeString(startingIndex++); s.TerritoryId = reader.GetSafeInt32(startingIndex++); p.Zip = reader.GetSafeString(startingIndex++); p.Country = reader.GetSafeInt32(startingIndex++); if (use == true) { p.OwnerId = reader.GetSafeInt32(++startingIndex); p.OwnerTypeId = reader.GetSafeInt32(++startingIndex); } p.State = s; return p; }