Esempio n. 1
0
        private async Task GenerateBusinessLogic(Table table, string projectName, string nameSpace)
        {
            var class_name = GetClassName(table);

            DTECore.Settings.Postfix += " : DomainBase";
            var model_code = await DTECore.CreateModelAsync(table.DataBaseName, table.TableName);

            var businessDomainfilePath    = $"{_businessProjectPath}/Domain/{class_name}.cs";
            var businessDataProxyfilePath = $"{_businessProjectPath}/DataProxy/I{class_name}DataProxy.cs";
            var businessServicefilePath   = $"{_businessProjectPath}/Service/{class_name}Service.cs";
            var model_domain = PeasyConstants.GetDomainTemplate(nameSpace, model_code);
            var dataProxy    = PeasyConstants.GetDataProxyTemplate(nameSpace, projectName, class_name);
            var service      = PeasyConstants.GetServiceTemplate(nameSpace, class_name);

            SaveFileThenAddToProject(businessDomainfilePath, model_domain, _businessProject);
            SaveFileThenAddToProject(businessDataProxyfilePath, dataProxy, _businessProject);
            SaveFileThenAddToProject(businessServicefilePath, service, _businessProject);
        }