Ejemplo n.º 1
0
        private CodeNamespaceImport[] GenerateImports()
        {
            var imports = new List <CodeNamespaceImport>
            {
                new CodeNamespaceImport("System"),
                new CodeNamespaceImport(TargetAppNameSpaceService.domainContractNamespaceName()),
                new CodeNamespaceImport(TargetAppNameSpaceService.dataAccessNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.domainServiceNamespaceName()),
                new CodeNamespaceImport(TargetAppNameSpaceService.EngineCommandNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.dataAccessNamespace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.EventSourcingNameSpace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.loggerNameSpace()),
                new CodeNamespaceImport(TargetAppNameSpaceService.xmlToolsNameSpace())
            };

            return(imports.ToArray());
        }
        public CodeNamespace Build(JdbcQueryActivity jdbcQueryActivity)
        {
            var serviceNameSpace = new CodeNamespace(TargetAppNameSpaceService.domainServiceNamespaceName());

            serviceNameSpace.Imports.AddRange(this.GenerateServiceImport(jdbcQueryActivity));


            var serviceToGenerate = new CodeTypeDeclaration();

            serviceToGenerate.IsClass        = true;
            serviceToGenerate.TypeAttributes = TypeAttributes.Public;

            serviceToGenerate.Name = VariableHelper.ToClassName(jdbcQueryActivity.ClassName) + "Service";

            //dataAccessToGenerate.Imports = this.GenerateImport (jdbcQueryActivity);
            serviceToGenerate.Members.AddRange(this.GenererateFields(jdbcQueryActivity));
            serviceToGenerate.Members.AddRange(this.GenererateContructors(jdbcQueryActivity, serviceToGenerate));
            serviceToGenerate.Members.AddRange(this.GenererateMethods(jdbcQueryActivity));

            serviceNameSpace.Types.Add(serviceToGenerate);

            return(serviceNameSpace);
        }