示例#1
0
        public async Task <IActionResult> DelRoleAsync(string ids)
        {
            List <Roles> roles = new List <Roles>();

            foreach (var item in ids.Split(","))
            {
                var role = await context.Roles.FindAsync(Convert.ToInt32(item));

                role.IsDel = 1;
                roles.Add(role);
            }
            context.UpdateRange(roles);
            await context.SaveChangesAsync();

            return(Ok(ids));
        }