public void MigrateBusinessProfile(Services.TpmContext cloudContext, Server.BusinessProfile serverBusinessProfile, Services.Partner cloudPartner) { Services.BusinessProfile cloudBusinessProfile = new Services.BusinessProfile() { Name = serverBusinessProfile.Name, Description = serverBusinessProfile.Description, Partner = cloudPartner }; cloudContext.AddToBusinessProfiles(cloudBusinessProfile); cloudContext.RelateEntities(cloudBusinessProfile, cloudPartner, "Partner", "BusinessProfiles", Services.RelationshipCardinality.ManyToOne); // Migrating the CustomSettings and business identities this.customSettingsMigrator.MigrateProfileCustomSettings(cloudContext, serverBusinessProfile, cloudBusinessProfile); this.businessIdentityMigrator.MigrateBusinessIdentities(cloudContext, serverBusinessProfile, cloudBusinessProfile); }
public void MigratePartnerCustomSettings(Services.TpmContext cloudContext, Server.Partner serverPartner, Services.Partner cloudPartner) { Dictionary <string, string> dict = new Dictionary <string, string>(); Server.CustomSettings serverCustomSettings = serverPartner.GetCustomSettings(); foreach (string key in serverCustomSettings.Keys) { dict[key] = serverCustomSettings[key]; } Services.CustomSetting cloudCustomSetting = new Services.CustomSetting() { Name = cloudPartner.Name }; cloudCustomSetting.Blob = ByteArrayFormatter <Dictionary <string, string> > .Serialize(dict); cloudContext.AddToCustomSettings(cloudCustomSetting); cloudContext.RelateEntities(cloudCustomSetting, cloudPartner, "Partner", "CustomSettings", Services.RelationshipCardinality.ManyToOne); }
public void MigrateBusinessProfiles(Services.TpmContext cloudContext, Server.Partner serverPartner, Services.Partner cloudPartner) { foreach (Server.BusinessProfile businessProfile in serverPartner.GetBusinessProfiles()) { this.MigrateBusinessProfile(cloudContext, businessProfile, cloudPartner); } }