示例#1
0
        public static void SetChildLoadOptions(DataLoadOptions loadOptions)
        {
            loadOptions.LoadWith <ForeignCitizenData>(fcd => fcd.BirthCountryRef);
            loadOptions.LoadWith <ForeignCitizenData>(fcd => fcd.ForeignCitizenCountries);

            ForeignCitizenCountry.SetChildLoadOptions(loadOptions);
        }
 public static CountryIdentificationCodeType ToXmlType(ForeignCitizenCountry db)
 {
     if (db != null)
     {
         return(CountryRef.ToXmlType(db.CountryRef));
     }
     return(null);
 }
 public static ForeignCitizenCountry[] FromXmlType(CountryIdentificationCodeType[] countries, bool isNationality)
 {
     if (countries != null)
     {
         int ordinal = 0;
         return(countries
                .Select(c => ForeignCitizenCountry.FromXmlType(c, isNationality, ordinal++))
                .Where(c => c != null)
                .ToArray());
     }
     return(new ForeignCitizenCountry[0]);
 }
 public static CountryIdentificationCodeType[] ToXmlType(EntitySet <ForeignCitizenCountry> fcc, bool isNationality)
 {
     if (fcc != null)
     {
         return(fcc.Where(f => f.IsNationality = isNationality)
                .OrderBy(f => f.Ordinal)
                .Select(f => ForeignCitizenCountry.ToXmlType(f))
                .Where(c => c != null)
                .ToArray());
     }
     return(null);
 }
示例#5
0
 /// <summary>
 /// Represents the ForeignCitizenData table
 /// </summary>
 public static UdenlandskBorgerType ToXmlType(ForeignCitizenData db)
 {
     if (db != null)
     {
         return(new UdenlandskBorgerType()
         {
             FoedselslandKode = CountryRef.ToXmlType(db.BirthCountryRef),
             PersonCivilRegistrationReplacementIdentifier = db.CivilRegistrationReplacementIdentifier,
             PersonIdentifikator = db.PersonIdentifier,
             SprogKode = ForeignCitizenCountry.ToXmlType(db.ForeignCitizenCountries, false),
             PersonNationalityCode = ForeignCitizenCountry.ToXmlType(db.ForeignCitizenCountries, true),
         });
     }
     return(null);
 }
示例#6
0
        public static ForeignCitizenData FromXmlType(UdenlandskBorgerType oio)
        {
            if (oio != null)
            {
                var ret = new ForeignCitizenData()
                {
                    BirthCountryRef = CountryRef.FromXmlType(oio.FoedselslandKode),
                    CivilRegistrationReplacementIdentifier = oio.PersonCivilRegistrationReplacementIdentifier,
                    PersonIdentifier = oio.PersonIdentifikator,
                };

                ret.ForeignCitizenCountries.AddRange(ForeignCitizenCountry.FromXmlType(oio.SprogKode, false));
                ret.ForeignCitizenCountries.AddRange(ForeignCitizenCountry.FromXmlType(oio.PersonNationalityCode, true));

                return(ret);
            }
            return(null);
        }