public static int Register(List <Models.WidgetManifest> manifests) { var count = 0; foreach (var manifest in manifests) { if (!Portal.Exists(manifest)) { Logging.Logger.InfoFormat("Registering manifest: {0}", manifest.FullName); Portal.Save(manifest, Account.AuditId); count++; } else { //todo: REALLY need to reconsider how to structure this logic... var m = Portal.GetWidgetManifest(manifest.FullName); manifest.Id = m.Id; if (manifest.ToJson() != m.ToJson()) { Logging.Logger.InfoFormat("Registering manifest: {0}", manifest.FullName); Portal.Save(manifest, Account.AuditId); count++; } } } //Repository.Current.SaveChanges(); return(count); }
public static int Register(Models.Portal portal) { var count = 0; if (!Portal.Exists(portal)) { Logging.Logger.InfoFormat("Registering portal: {0}", portal.Name); Portal.Save(portal, Account.AuditId); count++; } return(count); }
public static int Register(List <Models.LayoutTemplate> templates) { var count = 0; foreach (var template in templates) { template.PortalId = string.IsNullOrEmpty(template.PortalId) ? Services.Portal.CurrentPortalId : template.PortalId; if (!Portal.Exists(template)) { Logging.Logger.InfoFormat("Registering layout template: {0}", template.LayoutName); Portal.Save(template, Account.AuditId); count++; } } return(count); }