コード例 #1
0
ファイル: CSharpRepoGenerator.cs プロジェクト: devshorts/Atom
        public CSharpRepoGenerator(CSharpTargetConfig config)
        {
            if (config == null)
            {
                config = new CSharpTargetConfig();
            }

            _config = config;
        }
コード例 #2
0
        public CSharpSingleRepositoryGenerator(CSharpTargetConfig config)
        {
            if (config == null)
            {
                config = new CSharpTargetConfig();
            }

            _config = config;
        }
コード例 #3
0
ファイル: CSharpAccessBase.cs プロジェクト: devshorts/Atom
        public CSharpAccessBase(CSharpTargetConfig config)
        {
            Config = config;

            if (Config == null)
            {
                Config = new CSharpTargetConfig();
            }
        }
コード例 #4
0
ファイル: NamespaceGenerator.cs プロジェクト: devshorts/Atom
        public IEnumerable<string> GetNamespaces(CSharpTargetConfig config)
        {
            var namespaces = DefaultNamespaces();

            if (config.Entities.StrongTypes)
            {
                namespaces = namespaces.Concat(StrongTypeNamespaces());
            }
            return namespaces;
        }
コード例 #5
0
ファイル: CSharpVerb.cs プロジェクト: devshorts/Atom
        private IEnumerable<GeneratorResult> FromTargetConfigs(CSharpTargetConfig targetConfig)
        {
            var args = new GeneratorArguments<CSharpTargetConfig>(targetConfig, AtomsFolder, AtomCreator.LoadDefaults(AtomsFolder));

            if(targetConfig.Repository != null){
                var sqlArgs = new GeneratorArguments<SqlTargetConfig>(new SqlTargetConfig(), args.AtomsFolder, AtomCreator.LoadDefaults(AtomsFolder));
                var sqlGenerator = new SqlGenerator().Generate(sqlArgs);

                var repoResult = new RepositoryGenerator(sqlGenerator).Generate(args);

                repoResult.OutputPath = targetConfig.Repository.OutputPath;

                yield return repoResult;
            }

            var codeResult = new CodeGenerator().Generate(args);

            codeResult.OutputPath = targetConfig.Entities.OutputPath;

            yield return codeResult;
        }
コード例 #6
0
ファイル: CSharpVerb.cs プロジェクト: devshorts/Atom
        private CSharpTargetConfig GetConfig()
        {
            if (_cSharpTargetConfig != null)
            {
                return _cSharpTargetConfig;
            }

            var targetConfig = new CSharpTargetConfig
            {
                Entities =
                {
                    Namespace = DataNamespace,
                    OutputPath = OutputPath,
                    StrongTypes = StrongTypes
                }
            };

            if (GenerateRepo)
            {
                targetConfig.Repository = new RepositoryTargetConfiguration
                {
                    OutputPath = RepoOutputPath ?? OutputPath,
                    Namespace = RepoNamespace
                };
            }

            return targetConfig;
        }
コード例 #7
0
ファイル: CSharpVerb.cs プロジェクト: devshorts/Atom
 public CSharpVerb(string atomsPath, CSharpTargetConfig cSharpTargetConfig)
 {
     AtomsFolder = atomsPath;
     _cSharpTargetConfig = cSharpTargetConfig;
 }
コード例 #8
0
ファイル: NamespaceGenerator.cs プロジェクト: devshorts/Atom
        public string ByConfig(CSharpTargetConfig config)
        {
            var namespaces = GetNamespaces(config);

            return Header() + string.Join(Environment.NewLine, Usings(namespaces));
        }
コード例 #9
0
 public CSharpDapperDbAccessGenerator(CSharpTargetConfig config)
     : base(config)
 {
 }
コード例 #10
0
 public CSharpSprocAccessGenerator(CSharpTargetConfig config)
     : base(config)
 {
 }
コード例 #11
0
 public CSharpCodeClassGenerator(CSharpTargetConfig config)
     : base(config)
 {
 }