K
Kaibear
Guest
In addition, how do I actually execute my code? If, for example I build a generic function to create roles for me, which requires an input (the role name) and has it's own call of RoleManager.SaveChanges(); - how do I actually trigger Sitefinity to execute this script once, when I use a "main method", that calls the rolecreation function with a specific name? My code is: public class Sen_CreateSennRole { public void CreateSenRole(string roleName) { RoleManager roleManager = RoleManager.GetManager(); if (roleManager.GetRoles().Where(r => r.Name == roleName).FirstOrDefault() == null) { roleManager.CreateRole(roleName); } else { // Handle appropriately when the role already exists } roleManager.SaveChanges(); } }
Continue reading...
Continue reading...