Esempio n. 1
0
        public IFacadeUpdateResult <ReferenceData> SaveReferenceCategorysInBatch(IList <ReferenceInfoDto> references)
        {
            // Convert to data
            List <ReferenceData> instances = new List <ReferenceData>();

            foreach (ReferenceInfoDto item in references)
            {
                ReferenceData instance = new ReferenceData();
                instances.Add(instance);
                instance.Id = item.ReferenceId;
                instance.ReferenceCategorys = ReferenceCategoryInfoConverter.ConvertToData(item.ReferenceCategorys);
            }
            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey))
            {
                ReferenceFacade facade = new ReferenceFacade(uow);
                IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceCategorysInBatch(instances);
                return(result);
            }
        }
Esempio n. 2
0
 public IFacadeUpdateResult <ReferenceData> SaveReferenceCategorys(ReferenceInfoDto reference)
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey))
     {
         ReferenceFacade facade = new ReferenceFacade(uow);
         IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceCategorys(reference.ReferenceId, ReferenceCategoryInfoConverter.ConvertToData(reference.ReferenceCategorys));
         return(result);
     }
 }