public override async Task <ItemDataModel> CreateFromAsync(IDataFactory dataFactorySource, IDataFactory dataFactoryDestination, ItemDataModel itemDataModelSource, ItemDataModel itemDataModelDestinationParent, bool isTransfert, object data = null) { var itemDataModelDestination = await SiteBusinessModule.DuplicateAllAsync(_businessModuleFactory, dataFactorySource, dataFactoryDestination, itemDataModelSource, itemDataModelDestinationParent, isTransfert); var addSiteInput = data as CreateFromSiteModel; if (addSiteInput != null) { var siteBusinessModel = (MasterBusinessModel)itemDataModelDestination.Data; siteBusinessModel.Elements.First(e => e.Property == "Title").Data = addSiteInput.Title; // On met à jour les id des images var imageIcones = GetImages(siteBusinessModel, "ImageIcone"); if (imageIcones != null && imageIcones.Count > 0) { UpdateImageId(imageIcones, itemDataModelDestination); var element = siteBusinessModel.Elements.First(e => e.Property == "ImageIcone"); element.Data = JsonConvert.SerializeObject(imageIcones); } var imageLogos = GetImages(siteBusinessModel, "ImageLogo"); if (imageLogos != null && imageLogos.Count > 0) { UpdateImageId(imageLogos, itemDataModelDestination); var element = siteBusinessModel.Elements.First(e => e.Property == "ImageLogo"); element.Data = JsonConvert.SerializeObject(imageLogos); } } return(itemDataModelDestination); }
public override async Task <ItemDataModel> CreateFromAsync(IDataFactory dataFactorySource, IDataFactory dataFactoryDestination, ItemDataModel itemDataModelSource, ItemDataModel itemDataModelDestinationParent, bool isTransfert, object data = null) { var itemDataModelDestination = await SiteBusinessModule.DuplicateAllAsync(_businessModuleFactory, dataFactorySource, dataFactoryDestination, itemDataModelSource, itemDataModelDestinationParent, isTransfert); return(itemDataModelDestination); }
public override async Task <ItemDataModel> CreateFromAsync(IDataFactory dataFactorySource, IDataFactory dataFactoryDestination, ItemDataModel itemDataModelSource, ItemDataModel itemDataModelDestinationParent, bool isTransfert, object data = null) { // TODO attention les id des images ne sont pas mis à jour return (await SiteBusinessModule.DuplicateAllAsync(_businessModuleFactory, dataFactorySource, dataFactoryDestination, itemDataModelSource, itemDataModelDestinationParent, isTransfert, data)); }