public CSharpRepoGenerator(CSharpTargetConfig config) { if (config == null) { config = new CSharpTargetConfig(); } _config = config; }
public CSharpSingleRepositoryGenerator(CSharpTargetConfig config) { if (config == null) { config = new CSharpTargetConfig(); } _config = config; }
public CSharpAccessBase(CSharpTargetConfig config) { Config = config; if (Config == null) { Config = new CSharpTargetConfig(); } }
public IEnumerable<string> GetNamespaces(CSharpTargetConfig config) { var namespaces = DefaultNamespaces(); if (config.Entities.StrongTypes) { namespaces = namespaces.Concat(StrongTypeNamespaces()); } return namespaces; }
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; }
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; }
public CSharpVerb(string atomsPath, CSharpTargetConfig cSharpTargetConfig) { AtomsFolder = atomsPath; _cSharpTargetConfig = cSharpTargetConfig; }
public string ByConfig(CSharpTargetConfig config) { var namespaces = GetNamespaces(config); return Header() + string.Join(Environment.NewLine, Usings(namespaces)); }
public CSharpDapperDbAccessGenerator(CSharpTargetConfig config) : base(config) { }
public CSharpSprocAccessGenerator(CSharpTargetConfig config) : base(config) { }
public CSharpCodeClassGenerator(CSharpTargetConfig config) : base(config) { }