示例#1
0
        public OpResult Deletes(int[] ids)
        {
            var list = ProductRoleVerRepository.GetQuery(o => ids.Contains(o.Id)).Include(o => o.ProductRoles).Include("ProductRoles.ProductRoleDatas").ToList();

            if (list.Any(o => o.VerStatus > 0))
            {
                return(OpResult.Fail("该状态不允许删除!"));
            }
            ProductRoleDataRepository.RemoveRange(list.SelectMany(o => o.ProductRoles.SelectMany(i => i.ProductRoleDatas)).ToList(), false);
            ProductRoleRepository.RemoveRange(list.SelectMany(o => o.ProductRoles).ToList(), false);
            ProductRoleVerRepository.RemoveRange(list);
            return(OpResult.Success());
        }