public async Task <TRole> FindByIdAsync(string roleId, CancellationToken cancellationToken) { object convertedId = _options.ConvertStringToId(roleId); IQueryable <TRole> roles = _roles.Where(GetPredicat <TRole, object>(_options.RoleIdProperty, convertedId)); await roles.FetchAsync(); return(roles.FirstOrDefault()); }
public async Task <TUser> FindByIdAsync(string userId, CancellationToken cancellationToken) { object convertedId = _options.ConvertStringToId(userId); IQueryable <TUser> users = _users.Where(GetPredicat <TUser, object>(_options.UserIdProperty, convertedId)); await users.FetchAsync(); return(users.FirstOrDefault()); }