Пример #1
0
        /// <summary>
        /// 删除实体属性信息信息
        /// </summary>
        /// <param name="ids">要删除的实体属性信息编号</param>
        /// <returns>业务操作结果</returns>
        public async Task <OperationResult> DeleteCodeProperties(params Guid[] ids)
        {
            List <string> names = new List <string>();

            UnitOfWork.EnableTransaction();
            foreach (var id in ids)
            {
                var property = await PropertyRepository.GetAsync(id);

                if (property == null)
                {
                    continue;
                }

                int count = await PropertyRepository.DeleteAsync(property);

                if (count > 0)
                {
                    names.Add(property.Name);
                }
            }

            await UnitOfWork.CommitAsync();

            return(names.Count > 0
                ? new OperationResult(OperationResultType.Success, $"属性“{names.ExpandAndToString()}”删除成功")
                : OperationResult.NoChanged);
        }