Microsoft.AspNetCore.Identity.RoleManager<Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole>
github link to method 时, Claims
未填充FindByIdAsync(string id)
媒体资源
AddEntityFrameworkStores
中services.AddIdentity
的{{1}}可以启用eager loading吗?
public void ConfigureServices(IServiceCollection services){...}
答案 0 :(得分:0)
克隆/分叉https://github.com/aspnet/Identity并在RoleStore中使用.Include(...)
添加扩展方法暂时有用。
public virtual Task<TRole> GetByIdAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
var roleId = ConvertIdFromString(id);
return Roles.Include(r => r.Claims).Include(r => r.Users).FirstOrDefaultAsync(u => u.Id.Equals(roleId), cancellationToken);
}