Exemple #1
0
        /// <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);
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 public async Task <IdentityResult> DeleteAsync(ApplicationRole role, CancellationToken cancellationToken)
 {
     return(await roleStore.DeleteAsync(role, cancellationToken));
 }