コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }