using System; using System.Linq; using Composite.Data; using Composite.Data.Types; using Composite.Data.Transactions; namespace Composite.Tools.Installation { public class NewPlaceHolder { public static void CreatePlaceHolder(Guid gPageGuid, string sPlaceHolderId, string sContent) { using (System.Transactions.TransactionScope transactionScope = TransactionsFacade.CreateNewScope()) { using (DataScope dataScope = new DataScope(DataScopeIdentifier.Administrated)) { using (DataConnection connection = new DataConnection()) { IPagePlaceholderContent context = DataConnection.New(); context.PageId = gPageGuid; context.PlaceHolderId = sPlaceHolderId; context.Content = sContent; context.PublicationStatus = "draft"; IPagePlaceholderContent createdPagePlaceHolder = connection.Add(context); } } transactionScope.Complete(); } } } }