Ejemplo n.º 1
0
 public static CreateContentForRootWithName CreateContentForRootWithNameFunction(
     IContentService service, string orderTypeName, SetModelInIContent addingFunction = null)
 {
     if (addingFunction == null)
     {
         addingFunction = DefaultSetModelInIContent;
     }
     return((string name, dynamic model, int rootId, out int id) =>
     {
         CreateIContent(service, rootId, orderTypeName, addingFunction, model, out id, name);
     });
 }
Ejemplo n.º 2
0
 public static void CreateIContent(
     IContentService service, int rootId, string orderTypeName, SetModelInIContent addingFunction, dynamic model,
     out int id, string name = "")
 {
     try
     {
         if (name == "")
         {
             name = Guid.NewGuid().ToString();
         }
         var content = service.CreateContent(name, rootId, orderTypeName);
         content = addingFunction(model, content);
         service.Save(content);
         service.Publish(content);
         id = content.Id;
     }
     catch (Exception ex)
     {
         id = -1;
     }
 }