Esempio n. 1
0
        public void InsertIntoSolution(List <IAbpCtlItem> ctlItems, bool replaceFileForce = false)
        {
            var code        = GetText(ctlItems);
            var projectPath = AbpSolutionBll.GetProjectPath(AbpProjectType.WebHost);
            var path        = string.IsNullOrWhiteSpace(_subPath) ?
                              "Controllers" :
                              $"Controllers\\{_subPath}";

            path = System.IO.Path.Combine(projectPath, path);
            System.IO.Directory.CreateDirectory(path);
            var fileCtl = System.IO.Path.Combine(path, $"{_modelName}Controller.cs");

            AbpSolutionBll.InsertCodeFile(fileCtl, code, replaceFileForce);
        }
Esempio n. 2
0
        public void InsertIntoSolution()
        {
            var name        = _modelName.ToFirstLettleUpcase();
            var projectPath = AbpSolutionBll.GetProjectPath(AbpProjectType.Domain);
            var path        = string.IsNullOrWhiteSpace(_subPath) ?
                              $"{name}s" :
                              $"{_subPath}\\{name}s";

            path = System.IO.Path.Combine(projectPath, path);
            System.IO.Directory.CreateDirectory(path);
            var fileService   = System.IO.Path.Combine(path, $"{name}Manager.cs");
            var fileInterface = System.IO.Path.Combine(path, $"I{name}Manager.cs");

            AbpSolutionBll.InsertCodeFile(fileService, GetServiceText());
            AbpSolutionBll.InsertCodeFile(fileInterface, GetInterfaceText());
        }
Esempio n. 3
0
        public void InsertIntoSolution(List <IAbpCtlItem> ctlItems)
        {
            var name        = _modelName.ToFirstLettleUpcase();
            var projectPath = AbpSolutionBll.GetProjectPath(AbpProjectType.Application);
            var path        = string.IsNullOrWhiteSpace(_subPath) ?
                              $"{name}s" :
                              $"{_subPath}\\{name}s";

            path = System.IO.Path.Combine(projectPath, path);
            System.IO.Directory.CreateDirectory(path);
            var fileService          = System.IO.Path.Combine(path, $"{name}Service.cs");
            var fileInterface        = System.IO.Path.Combine(path, $"I{name}Service.cs");
            var fileServiceInterface = System.IO.Path.Combine(path, $"I{name}Service.cs");
            var appItems             = ctlItems.Select(x => x.ToAppItem()).ToList();

            AbpSolutionBll.InsertCodeFile(fileService, GetServiceText(appItems));
            AbpSolutionBll.InsertCodeFile(fileInterface, GetInterfaceText(appItems));
            AbpSolutionBll.InsertCodeFile(fileServiceInterface, "");

            InsetDtoFiles(ctlItems, path);
        }