Ejemplo n.º 1
0
 public static Category CreateRoot(string name, Website website, PermissionSet permSet)
 {
     return(Create(name, "index", null, website, permSet));
 }
Ejemplo n.º 2
0
        public static Category Create(string name, string defaultPage, Category parent, Website website, PermissionSet permSet)
        {
            var slug = SlugHelper.Generate(name);

            return(new Category()
            {
                Name = name,
                UrlAlias = slug,
                Parent = parent,
                DefaultPage = defaultPage,
                Website = website,
                Tenant = website.Tenant,
                IsRoot = (null == parent),
                UniquePath = (parent != null) ? string.Format("{0}{1}/", parent.UniquePath, slug) : "/",
                PermissionSet = permSet
            });
        }