public bool Create(WorkFlow entity) { entity.OrganizationId = _appContext.OrganizationId; var result = true; using (UnitOfWork.Build(_workFlowRepository.DbContext)) { result = _workFlowRepository.Create(entity); //solution component _solutionComponentService.Create(entity.SolutionId, entity.WorkFlowId, WorkFlowDefaults.ModuleName); //依赖于实体 _dependencyService.Create(entity); //本地化标签 _localizedLabelService.Create(entity.SolutionId, entity.Name.IfEmpty(""), WorkFlowDefaults.ModuleName, "LocalizedName", entity.WorkFlowId, _appContext.BaseLanguage); _localizedLabelService.Create(entity.SolutionId, entity.Description.IfEmpty(""), WorkFlowDefaults.ModuleName, "Description", entity.WorkFlowId, _appContext.BaseLanguage); } return(result); }