public override void CreateRole(string roleName) { //Check required for MSDN if (roleName == null || roleName == "") { throw new ProviderException("Role name cannot be empty or null."); } if (roleName.IndexOf(',') > 0) { throw new ArgumentException("Role names cannot contain commas."); } if (RoleExists(roleName)) { throw new ProviderException("Role name already exists."); } using (var transaction = new TransactionScope(mConfiguration)) { var roleStore = new RoleDataStore(transaction); roleStore.Insert(new Role(ApplicationName, roleName)); transaction.Commit(); } }
public override void CreateRole(string roleName) { using (var transaction = new TransactionScope(mConfiguration)) { var roleDataStore = new RoleDataStore(transaction); var role = new Role(ApplicationName, roleName); roleDataStore.Insert(role); transaction.Commit(); } }