我收到此错误消息:
偶然发现的同伴来源:
System.Linq.Enumerable.Single [TSource](IEnumerable1 source, Func
2谓词)“zh_cn Abp.EntityHistory.EntityHistoryHelper.GetEntitySet(ObjectContext上下文,EntityType实体类型)
zh_cn Abp.EntityHistory.EntityHistoryHelper.CreateEntityChangeSet(DbContext上下文)
zh_cn Abp.Zero.EntityFramework.AbpZeroCommonDbContext`2.SaveChanges()
zh_cn Abp.EntityFramework.Uow.EfUnitOfWork.SaveChangesInDbContext(DbContext dbContext)
zh-cn Abp.EntityFramework.Uow.EfUnitOfWork.SaveChanges()
zh-cn Sonda.Gestor.Roles.RoleAppService.d__6.MoveNext()
zh-CN C:\ Users \ eesaah \ Desktop \ Sonda.Gestor \ 5.0.0 \ src \ Sonda.Gestor.Application \ Roles \ RoleAppService.cs:linea 57
方法是
public override async Task<RoleDto> CreateAsync(CreateRoleDto input)
{
try
{
CheckCreatePermission();
var role = ObjectMapper.Map<Role>(input);
CheckErrors(await _roleManager.CreateAsync(role));
UnitOfWorkManager.Current.SaveChanges();
var grantedPermissions = PermissionManager
.GetAllPermissions()
.Where(p => input.GrantedPermissions.Contains(p.Name))
.ToList();
await _roleManager.SetGrantedPermissionsAsync(role, grantedPermissions);
UnitOfWorkManager.Current.SaveChanges();
return MapToEntityDto(role);
}
catch (System.Exception vEx)
{
throw vEx;
}
}
错误在
中产生roleManager.SetGrantedPermissionsAsync(role, grantedPermissions)
模板版本为5.0多页mvc。
我也尝试过:
我该怎么做才能解决此问题?