小编Aks*_*kar的帖子

ElasticSearch.Net dll隔离来自Antivirus - WS.Reputation.1

Symantec Antivirus会隔离ElasticSearch.Net dll,并在启动访问被拒绝错误时关闭Web应用程序.

ElasticSearch.NET版本:2.3.1

赛门铁克版本:12.1.6

我在异常中添加了但是我需要知道为什么弹性搜索dll会被隔离.

.net symantec web-applications elasticsearch

8
推荐指数
1
解决办法
170
查看次数

如何使用System.Cryptography解密EncryptedAssertion

身份提供程序使用component pro的功能加密Saml Assertion

Dim encryptedSamlAssertion As New EncryptedAssertion(samlAssertion, encryptingCert, New System.Security.Cryptography.Xml.EncryptionMethod(SamlKeyAlgorithm.Aes256Cbc))
Run Code Online (Sandbox Code Playgroud)

在服务提供商,我试图解密断言.但我不能使用组件专业版.我必须使用System.Security.Cryptography

  • X509Certificate用于加密和解密
  • Aes256Cbc是加密算法

请帮助我提供一些有关如何使用X509Certificate和Aes256Cbc算法实现SamlAssertions解密的更多信息

.net c# x509certificate2 aescryptoserviceprovider saml-2.0

6
推荐指数
1
解决办法
1067
查看次数

如何在 LINQ where 子句中传递 func 表达式?

这是我要传入 where 子句的自定义过滤器(Func)

Func<Project,bool> filter = f =>
{
    bool filteredContent = true;
    if (!CreatorId.Equals(0))
        filteredContent = f.CreatedBy.Equals(CreatorId);

    if (filteredContent && !VerticalMarketId.Equals(0))
        filteredContent = f.VerticalMarketsId.Equals(VerticalMarketId);

    if (filteredContent && !ProductCategoryId.Equals(0))
        filteredContent = f.ProductCategoriesId.Equals(ProductCategoryId);

    return filteredContent;

};
Run Code Online (Sandbox Code Playgroud)

这是我的代码,我根据过滤器表达式中创建的条件获取所有项目

 getProjects = await _context.Projects.Where(x => x.IsDeleted == false && filter.Invoke(x))// Here I'm getting the exception
                .Include(PC => PC.ProjectComments.Where(x => x.IsDeleted == false))
                .Include(SP => SP.SharedProjects)
                .AsNoTracking().ToListAsync();
Run Code Online (Sandbox Code Playgroud)

异常:无法翻译 LINQ 表达式(DbSet......)。以可翻译的形式重写查询,或者通过插入对“AsEnumerable”、“AsAsyncEnumerable”、“ToList”或“ToListAsync”的调用来显式切换到客户端计算。

有人可以告诉我如何使用其中的表达式过滤数据吗?

注意:我可以在应用过滤器之前执行 ToListAsync() ,但它会从数据库获取所有记录,然后在客户端进行过滤。但我想在服务器端过滤数据。

c# linq iqueryable where-clause entity-framework-core

5
推荐指数
1
解决办法
4755
查看次数