public async Task OnExecuteNewRepositoryCommandAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); IRepositoryGenerator repositoryGenerator = MefComponents.GetRepositoryGenerator(); var infra = RepositoryGeneratorParametersFactory.Create(); var window = infra.View; var dialogResult = window.ShowModal(); if (dialogResult == true) { var model = infra.ViewModel; await repositoryGenerator.CreateRepositoryAsync(model, new CancellationToken()); } }
public void Generate(List<Table> tables, Configuration config, IRepositoryGenerator repoGenerator) { if (config.GenerateClasses) { var entityGenerator = new EntityGenerator(config, repoGenerator); tables.ForEach(m => entityGenerator.Generate(m)); } if (config.GenerateControllers) { var controllerGenerator = new ControllerGenerator(config); tables.ForEach(m => { var pkColumn = m.Columns.FirstOrDefault(x => x.IsPrimaryKey); string idType = (pkColumn == null) ? "int" : pkColumn.Type; controllerGenerator.Generate(m.Name.UppercaseFirst(), idType); }); } }
public EntityGenerator(Configuration config, IRepositoryGenerator repoGenerator) { _config = config; _repositoryGenerator = repoGenerator; }
public RepositoryScaffolder(ScaffolderDependencies dependencies, IRepositoryGenerator generator) : base(dependencies) { Generator = generator; }