草庐IT

fetched-properties

全部标签

c# - 验证错误 : The value 'on' is not valid for <<property name>>

在我的项目中,我有一个模型,您可以在这里看到我模型的一部分:publicclassCheckoutModel{publicboolOtherPlace{get;set;}[RequiredIf("OtherPlace",true,ErrorMessage="")]publicstringOtherPlaceFullName{get;set;}[RequiredIf("OtherPlace",true,ErrorMessage="")]publicintOtherPlaceProvinceId{get;set;}[RequiredIf("OtherPlace",true,ErrorMes

c# - 执行非查询 : Connection property has not been initialized.

下午,所以我已经在这个问题上研究了几个小时,但无法真正克服最后一个障碍。下面是我正在编写的这个程序的代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Diagnostics;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Configuration;namespaceTest{classProgram{staticvoidMain(){EventLogalog=newEventLog();

c# - 如何在 asp.net core 中使用 Fetch api 将数据传递给 Controller

我在我的客户端js脚本中使用这样的fetch发布数据fetch('/myarea/mycontroller/myaction',{method:'post',body:JSON.stringify({name:namevalue,address:addressvalue})}).then(function(response){if(response.status!==200){console.log('fetchreturnednotok'+response.status);}response.json().then(function(data){console.log('fetchr

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# - 如何解决 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# - 多线程,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# - ASP.NET Core 浏览器链接 `Unable to get property ' 文件'`

在MicrosoftVirtualAcademy类(class)中'IntroductiontoASP.NETCore(formerlyASP.NET5)',视频3,在39:00,他们演示了BrowserLink如何在Edge的F12工具和VisualStudio之间同步代码选择。我还没有看到开箱即用的相同功能。我不知道是否有设置或特殊功能来启用此功能。如果有,它没有在类(class)视频中显示,但视频又是几个月前的了。我以前从未见过此功能。BrowserLink从Edge连接到VisualStudio,在VS中的BrowserLinkDashboard中可以看到。没关系。Edge中有