草庐IT

nested-properties

全部标签

c# - CA1819 : Properties shouldn't return arrays - What is the right alternative?

我以前遇到过这个FxCop规则,但对如何解决违规问题并不满意(thread1、thread2)。我现在有另一个案例,我需要纠正违反CA1819的行为亲切。具体来说,我有一个算法库,它使用如下所示的公共(public)“输入对象”对曲线(x,y)执行一些分析计算:publicclassInputObject{publicdouble[]X{get;set;}publicdouble[]Y{get;set;}//+lotsofotherthingswell}此对象的X和Y属性在库中的数百个位置使用,通常使用索引。输入对象永远不会被算法改变,但实际上如果是这样也无关紧要。另外,.Length

c# - ASP.NET MVC3 中的 Razor 和接口(interface)继承 : why can't this property be found?

我在ASP.NETMVC3应用程序中的一个RazorView有一个奇怪的问题。当我将其值写入调试器控制台时,该属性似乎确实存在,但我收到一条错误消息,告诉我无法找到该属性。我的View将一个名为FormEditViewModel的类作为其模型。FormEditViewModel有一个IForm类型的属性,一个继承自另一个接口(interface)IFormObject的接口(interface)。IFormObject定义了一个属性Name,因此任何实现IForm的东西都必须实现一个名为Name的属性。具体类型Form实现接口(interface)IForm并根据需要定义Name属性。

c# - MSBuild 未处理的异常 : The FileName property should not be a directory unless UseShellExecute is set

版本dotnet核心SDK:2.1.403docker:18.09.7Linux内核:5.0.0-27Ubuntu:18.04.3问题我正在docker中运行一个ASP.NETCore项目。当我docker-composeup时,我得到以下信息:UnhandledException:Microsoft.Build.BackEnd.NodeFailedToLaunchException:TheFileNamepropertyshouldnotbeadirectoryunlessUseShellExecuteisset.--->System.ComponentModel.Win32Exce

c# - ElasticSearch NEST 搜索多种类型和所有字段

使用ElasticSearchNEST,我无法从查询中获得预期的结果。我的索引/类型布局如下:剧院(索引)事件(类型)剧院促销一般内容这些类型中的每一个都有自己的字段,我正在使用NEST的Index()方法来索引数据。我可以通过以下方式验证它是否被正确索引:查看http://localhost:9200/theatres/_mapping使用Head查看数据的插件作为引用,这是我的客户端配置://TODO:Putsettingsinconfigvarnode=newUri("http://localhost:9200");varconnSettings=newConnectionSet

c# - 如何在 NEST 中禁用驼峰式 Elasticsearch 字段名称?

默认情况下,NEST在将对象发送到Elasticsearch进行索引时会采用驼峰式命名对象和属性名称。如何在NESTforElasticsearch文档中禁用驼峰式字段名称?我做了相当多的研究,并且有一个mailinglistthread关于这个主题,但它似乎已经过时,因为某些方法已重命名或不再存在。IConnectionPoolconnectionPool=newSniffingConnectionPool(m_ElasticsearchNodeUris);ConnectionSettingssettings=newConnectionSettings(connectionPool)

c# - 如何解决 ReSharper 仅针对显示/值成员的属性的 "unused property"警告?

我已经为一个对象定义了两个属性,“Name”和“ID”,我将其用于具有BindingList数据源的ComboBox的DisplayMember和ValueMember。我最近安装了ReSharper来评估它。ReSharper在对象上向我发出警告,指出这两个属性未被使用。示例代码:BindingListSampleList=newBindingList();//populateSampleListcmbSampleSelector.DisplayMember="Name";cmdSampleSelector.ValueMember="ID";cmbSampleSelector.Dat

Cucumber extend reports的extent.properties配置

extent.reporter.spark.class=tech.grasshopper.reporters.ReporterAdapter$SparkReportAdapterextent.reporter.json.class=tech.grasshopper.reporters.ReporterAdapter$JsonReportAdapterextent.reporter.pdf.class=tech.grasshopper.reporters.ReporterAdapter$PDFReportAdapterextent.reporter.html.class=tech.grassho

c# - 什么是 "Nested Quantifier",为什么它会导致我的正则表达式失败?

我在regexbuddy中构建并测试了这个regex。"_[0-9]{10}+{1}+[0-9]{10}+{2}+[0-9]{6}+{2}[0-9]{2}"当我在.NetC#中使用它时我收到异常"parsing\"_[0-9]{10}++[0-9]{10}++[0-9]{6}+[0-9]{2}\"-Nestedquantifier+."这个错误是什么意思?显然.net不喜欢这个表达。这是正则表达式伙伴,所以你可以理解我对正则表达式的意图......_[0-9]{10}+{1}+[0-9]{10}+{2}+[0-9]{6}+{2}[0-9]{2}Matchthecharacters"_"

c# - 多线程,Task.Run 错误 'The call is ambiguous between the following methods or properties'

当我尝试构建项目时,显示以下错误消息。Thecallisambiguousbetweenthefollowingmethodsorproperties:'System.Threading.Tasks.Task.Run(System.Action)'and'System.Threading.Tasks.Task.Run(System.Func)'我该如何解决这个问题?publicstaticclassMaintananceManager{privatestaticThreadSafeSocialMediaListPostList=newThreadSafeSocialMediaList(

c# - 你如何调试你的 Nest 查询?

我是Nest的新手,我很可能不会像我想的那样创建查询。我的问题更像是授人以鱼不如授人以渔。但是,我将以我当前的问题为例。我在ElasticSearch中有几个Series类型的文档。我将在没有属性和公共(public)修饰符的情况下将其stub,仅包含与查询相关的信息:classSeries{stringId{get;set;}DateTimeStartDate{get;set;}DateTimeEndDate{get;set;}HashSetReleasableTo{get;set;}}这些都很好,花花公子。我可以Get()Series对象没问题。我遇到的问题是试图弄清楚Nest如何