Esempio n. 1
0
        private void InsertDtoFile(string path, string dtoName)
        {
            var    fileDto = System.IO.Path.Combine(path, $"{dtoName}.cs");
            string code    = GetDtoCode(dtoName);

            AbpSolutionBll.InsertCodeFile(fileDto, code);
        }
Esempio n. 2
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. 3
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. 4
0
        private void InsetDtoFiles(List <IAbpCtlItem> ctlItems, string dtoBasePath)
        {
            var dtoPath = System.IO.Path.Combine(dtoBasePath, "Dto");

            System.IO.Directory.CreateDirectory(dtoPath);
            var dtos = ctlItems.SelectMany(x => x.Dtos).Distinct();

            foreach (var dto in dtos)
            {
                InsertDtoFile(dtoPath, dto);
            }
            var fileDtoMapperProfile = System.IO.Path.Combine(dtoPath, $"{_modelName}Profile.cs");

            AbpSolutionBll.InsertCodeFile(fileDtoMapperProfile,
                                          (new AbpAppDtoMapperProfile())
                                          .GetText(AbpSolutionBll.GetRootNameSpace(), _subPath, _modelName));
        }
Esempio n. 5
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);
        }