Exemplo n.º 1
0
        internal static ExternalModelRoleMember CreateUnassigned()
        {
            var obj = new ExternalModelRoleMember(new TOM.ExternalModelRoleMember {
                IdentityProvider = "AzureAD"
            });

            obj.Init();
            return(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new ExternalModelRoleMember and adds it to the parent ModelRole.
        /// Also creates the underlying metadataobject and adds it to the TOM tree.
        /// </summary>
        public static ExternalModelRoleMember CreateNew(ModelRole parent, string name, string identityProvider)
        {
            if (TabularModelHandler.Singleton.UsePowerBIGovernance && !PowerBI.PowerBIGovernance.AllowCreate(typeof(ExternalModelRoleMember)))
            {
                throw new InvalidOperationException(string.Format(Messages.CannotCreatePowerBIObject, typeof(ExternalModelRoleMember).GetTypeName()));
            }

            var metadataObject = new TOM.ExternalModelRoleMember();

            metadataObject.IdentityProvider = identityProvider;
            metadataObject.MemberName       = name;
            var obj = new ExternalModelRoleMember(metadataObject);

            parent.Members.Add(obj);

            obj.Init();

            return(obj);
        }
Exemplo n.º 3
0
 public ExternalModelRoleMember AddExternalMember(string memberName)
 {
     return(ExternalModelRoleMember.CreateNew(this, memberName, "AzureAD"));
 }