示例#1
0
        /// <summary>
        /// Creates the specified DAC type.
        /// </summary>
        /// <param name="type">The DAC type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IDataAccessComponent Create(DacType type, params object[] args)
        {
            // get attribuye value
            QualifiedTypeNameAttribute qualifiedNameAttr = EnumAttributeUtility <DacType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            // create instance
            return((IDataAccessComponent)this.CreateObjectInstance(qualifiedNameAttr.AssemblyFileName, qualifiedNameAttr.QualifiedTypeName, args));
        }
示例#2
0
        public void DeployAction()
        {
            DacStore  dacStore = null;
            Stopwatch sw       = new Stopwatch();

            try
            {
                DacType dacType = DacType.Load(File.Open(this.fileName, FileMode.Open));
                Console.WriteLine("Deploy started: {0}", DateTime.Now);

                ServerConnection connection = this.GetServerConnection(null);

                sw.Start();

                dacStore = new DacStore(connection);

                this.EventSubscribe(dacStore);

                // Build the deployment properties.
                DatabaseDeploymentProperties ddp = new DatabaseDeploymentProperties(connection, this.database);

                // Set the azure editions (defaults will accept standard Azure account settings)
                ddp.AzureEdition = this.azureEdition;

                if (this.azureSize > 0)
                {
                    ddp.AzureMaxSize = this.azureSize;
                }

                dacStore.Install(dacType, ddp, true);
            }
            catch (DacException dacex)
            {
                Console.WriteLine("DAC Exception: {0}", dacex);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Unhandled Exception: {0}", ex);
            }
            finally
            {
                sw.Stop();
                Console.WriteLine("Deploy Complete.  Total time: {0}", sw.Elapsed.ToString());

                this.EventUnsubscribe(dacStore);
            }
        }
示例#3
0
        private DacSemanticModel(PXContext pxContext, DacType dacType, INamedTypeSymbol symbol, ClassDeclarationSyntax node,
                                 CancellationToken cancellation)
        {
            cancellation.ThrowIfCancellationRequested();

            _pxContext    = pxContext;
            _cancellation = cancellation;
            DacType       = dacType;
            Node          = node;
            Symbol        = symbol;
            DacSymbol     = DacType == DacType.Dac
                                ? Symbol
                                : Symbol.GetDacFromDacExtension(_pxContext);

            FieldsByNames     = GetDacFields();
            PropertiesByNames = GetDacProperties();
        }
示例#4
0
        private DacSemanticModel(PXContext pxContext, DacType dacType, INamedTypeSymbol symbol, ClassDeclarationSyntax node,
                                 CancellationToken cancellation)
        {
            cancellation.ThrowIfCancellationRequested();

            _pxContext    = pxContext;
            _cancellation = cancellation;
            DacType       = dacType;
            Node          = node;
            Symbol        = symbol;
            DacSymbol     = DacType == DacType.Dac
                                ? Symbol
                                : Symbol.GetDacFromDacExtension(_pxContext);
            IsMappedCacheExtension = Symbol.InheritsFromOrEquals(_pxContext.PXMappedCacheExtensionType);

            FieldsByNames      = GetDacFields();
            PropertiesByNames  = GetDacProperties();
            IsActiveMethodInfo = GetIsActiveMethodInfo();
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DacBase"/> class.
 /// </summary>
 /// <param name="dacType">Type of the dac.</param>
 protected DacBase(DacType dacType)
 {
     this.Type = dacType;
 }