/// <summary> /// 删除 /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <ResponseMessage <bool> > RoleDeleteAsync(string id) { var response = new ResponseMessage <bool>() { Extension = false }; if (await _roleStore.DeleteAsync(id)) { response.Extension = true; } return(response); }
public async Task RoleStore_create_find_delete() { var role = _roleTestFactory.CreateRole(); await _roleStore.CreateAsync(role, default(CancellationToken)); await _roleStore.SetNormalizedRoleNameAsync(role, role.Name, default(CancellationToken)); var fetchedRole = await _roleStore.FindByNameAsync(role.Name, default(CancellationToken)); role.Name.ShouldMatch(fetchedRole.Name); await _roleStore.DeleteAsync(role, default(CancellationToken)); fetchedRole = await _roleStore.FindByNameAsync(role.Name, default(CancellationToken)); fetchedRole.ShouldBeNull(); }
public async Task <IdentityResult> DeleteAsync(ApplicationRole role, CancellationToken cancellationToken) { return(await roleStore.DeleteAsync(role, cancellationToken)); }