/// <summary>
        /// Provides the model element that this cmdlet operates on
        /// </summary>
        /// <returns>A model object</returns>
        protected override AuditingPolicyModel GetEntity()
        {
            if (AuditType == AuditType.Table)
            {
                DatabaseAuditingPolicyModel model;
                try
                {
                    ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId, out model);
                    return(model);
                }
                catch
                {
                    return(null);
                }
            }
            DatabaseBlobAuditingPolicyModel blobModel;

            try
            {
                ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId, out blobModel);
            }
            catch
            {
                return(null);
            }
            return(blobModel);
        }
Beispiel #2
0
        private AuditingPolicyModel GetEntityHelper()
        {
            if (AuditType == AuditType.Table)
            {
                DatabaseAuditingPolicyModel model;
                ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId, out model);
                return(model);
            }

            if (AuditType == AuditType.Blob)
            {
                DatabaseBlobAuditingPolicyModel blobModel;
                ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId, out blobModel);
                return(blobModel);
            }

            return(null);
        }
Beispiel #3
0
 /// <summary>
 /// Provides the model element that this cmdlet operates on
 /// </summary>
 /// <returns>A model object</returns>
 protected override DatabaseAuditingPolicyModel GetModel()
 {
     return(ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId));
 }