草庐IT

error_code

全部标签

c# - Entity Framework 4.1 RC : Code First EntityTypeConfiguration inheritance issue

我正在尝试使用一个通用的EntityTypeConfiguration类来为我的所有实体配置主键,以便每个派生配置类不会重复自身。我的所有实体都实现了一个通用接口(interface)IEntity(表示每个实体都必须有一个int类型的Id属性)。我的配置基类如下所示:publicclassEntityConfiguration:EntityTypeConfigurationwhereTEntity:class,IEntity{publicEntityConfiguration(){HasKey(e=>e.Id);Property(e=>e.Id).HasDatabaseGenerat

c# - 如何使用 Simple injector、Repository 和 Context - code first

我正在尝试使用SimpleInjector创建我的存储库并在业务逻辑层中使用它(我也想使用PerWebRequest方法)。在DAL层我有:publicinterfaceIRepositorywhereT:class{voidAdd(Tentity);voidDelete(Tentity);voidDelete(intid);voidUpdate(Tentity);TGetById(intId);IQueryableAll();IEnumerableFind(Funcpredicate);}和:publicclassEFRepository:IRepository,IDisposabl

c# - "unexpected response code for operation : 1"是什么意思?

我从尝试在Azure表存储中插入记录的应用程序中收到“意外的操作响应代码:1”。基本上是将数据放在TableOperation中,并且已经按100行block对插入进行了批处理。在网络上真的找不到很多关于此Azure错误消息中特定“1”代码的信息。 最佳答案 当批处理操作失败时,表服务返回HTTP状态代码400,同时发送导致该批处理失败的实体的索引。"unexpectedresponsecodeforoperation:1"这意味着在批处理中的位置1处插入实体时出现错误。 关于c#-"u

c# - Entity Framework Code First 中的有效原始属性是什么?

当我尝试将列映射到我的模型类中的char数据类型时,出现错误:Theproperty'[ColumnName]'isnotadeclaredpropertyontype'[ClassName]'.VerifythatthepropertyhasnotbeenexplicitlyexcludedfromthemodelbyusingtheIgnoremethodorNotMappedAttributedataannotation.Makesurethatitisavalidprimitiveproperty.EFCodeFirst的有效基元类型是什么? 最佳答

c# - 无法从传输连接读取数据 : The connection was closed error in console application

我在控制台应用程序中有这段代码,它在一个循环中运行try{HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(search);request.Headers.Add("Accept-Language","de-DE");request.Method="GET";request.Accept="text/html";using(HttpWebResponseresponse=(HttpWebResponse)request.GetResponse()){using(StreamReaderreader=newStreamRead

c# - Entity Framework 4 Code First 是否支持像 NHibernate 这样的身份生成器?

一年前问的这个问题是类似的:DoestheEntityFramework4supportgeneratorsforidvalueslikeNHibernate?但我想知道代码优先CTP是否添加了对身份生成策略的支持。如果没有,有人知道EF中的一个很好的扩展点来实现类似的东西吗?我目前正在处理使用GUID作为标识符的模型类。使用EF插入时,它们会保留其Guid.Empty初始值。我知道您可以将数据库中列的默认值设置为newid()但这违背了客户端身份生成的目的。EntityFramework是否不够成熟,无法在分布式、断开连接的系统中使用? 最佳答案

c# - AngularJS 与 Asp.net Web API : $http post returning XMLHttpRequest cannot load: Response for preflight has invalid HTTP status code 405

当尝试使用$http将jsonPOST到Asp.netwebAPI服务器时,它返回以下错误XMLHttpRequestcannotloadhttp://localhost:62158/api/video/add.ResponseforpreflighthasinvalidHTTPstatuscode405但是从$.ajax发出相同的请求是工作文件。$HTTP代码$http.post(url,data,config).success(function(data,status,headers,config){defered.resolve(data);}).error(function(d

c# - MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3243,9) : error MSB4094

在VSUltimate201312.0.21005.1REL中打开我的VSUltimate2012C#解决方案后,我收到以下警告:Warning1Foundconflictsbetweendifferentversionsofthesamedependentassembly.Pleasesetthe"AutoGenerateBindingRedirects"propertytotrueintheprojectfile.Formoreinformation,seehttp://go.microsoft.com/fwlink/?LinkId=294190.EnergyMS我遵循Micros

c# - 在 Sql Server 连接字符串中使用 Encrypt=yes -> "provider: SSL Provider, error: 0 - The certificate' s CN 名称与传递的值不匹配。”

我在SQLServer连接字符串中使用Encrypt=yes,因为我需要对TCPIP流量进行加密,但是在打开连接时出现错误:Aconnectionwassuccessfullyestablishedwiththeserver,butthenanerroroccurredduringthepre-loginhandshake.(provider:SSLProvider,error:0-Thecertificate'sCNnamedoesnotmatchthepassedvalue.)关于如何解决这个问题有什么建议吗?我假设我的服务器之间需要某种证书关系,但不知道从哪里开始。我需要这个用于

c# - 构建 : error MSB4062 Microsoft. Build.Tasks.ResolveComReference 时出现 .NET Core 错误

我正在开发.net核心网络应用程序(针对net461)。该应用需要引用COMdll。我添加了COM引用,应用程序仍然在我的开发机器上构建。但是,在构建服务器上它无法构建并出现此错误:C:\ProgramFiles(x86)\dotnet\sdk\2.0.0\Microsoft.Common.CurrentVersion.targets(2604,5):错误MSB4062:“Microsoft.Build.Tasks.ResolveComReference”任务无法从程序集Microsoft.Build.Tasks.Core加载经过一番搜索,这似乎是一个非常不常见的错误。任何人都知道错误