Inheritance: EFDALBaseTemplate
Ejemplo n.º 1
0
        public override void Generate()
        {
            {
                var template     = new SSDLTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
                eventArgs.Properties.Add("BuildAction", 3);
                OnProjectItemGenerated(this, eventArgs);
            }

            if (_model.Database.Tables.Any(x => x.IsTenant && x.Generated))
            {
                var template     = new SSDLAdminTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
                eventArgs.Properties.Add("BuildAction", 3);
                OnProjectItemGenerated(this, eventArgs);
            }
            else
            {
                //If this is not a tenant model then remove the admin SSDL file
                var template     = new SSDLAdminTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Ejemplo n.º 2
0
        public override void Generate()
        {
            {
                var template = new SSDLTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
                eventArgs.Properties.Add("BuildAction", 3);
                OnProjectItemGenerated(this, eventArgs);
            }

            if (_model.Database.Tables.Any(x => x.IsTenant && x.Generated))
            {
                var template = new SSDLAdminTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
                eventArgs.Properties.Add("BuildAction", 3);
                OnProjectItemGenerated(this, eventArgs);
            }
            else
            {
                //If this is not a tenant model then remove the admin SSDL file
                var template = new SSDLAdminTemplate(_model);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
            OnGenerationComplete(this, gcEventArgs);
        }