草庐IT

entity-system

全部标签

c# - 在构建系统已引用 System.Core 时添加对它的引用

VisualStudioIntellisense无法识别动态关键字,即使项目已构建。我试图添加对System.Core的引用来解决问题。我收到此错误:Areferenceto'System.Core'couldnotbeadded.Thiscomponentisalreadyautomaticallyreferencedbythebuildsystem.我注意到我的其他项目引用了System.Core。我的修复是通过直接编辑csproj来添加它,这修复了Intellisense。是什么赋予了?为什么VS不让我通过UI来做? 最佳答案

c# - Entity Framework : A referential integrity constraint violation on many to many relationship

嘿,我有一个带有大量进程内缓存和EntityFramework的应用程序。当我想对实体进行更新时,我会重新附加缓存的副本。我跟踪在上下文的生命周期中附加的所有内容,因此我不会尝试附加它们两次。我在附加时发生了一个错误(在大多数情况下很少见,这工作正常并且非常快),它说了以下内容:Areferentialintegrityconstraintviolationoccurred:Thepropertyvaluesthatdefinethereferentialconstraintsarenotconsistentbetweenprincipalanddependentobjectsinth

c# - Entity Framework : A referential integrity constraint violation on many to many relationship

嘿,我有一个带有大量进程内缓存和EntityFramework的应用程序。当我想对实体进行更新时,我会重新附加缓存的副本。我跟踪在上下文的生命周期中附加的所有内容,因此我不会尝试附加它们两次。我在附加时发生了一个错误(在大多数情况下很少见,这工作正常并且非常快),它说了以下内容:Areferentialintegrityconstraintviolationoccurred:Thepropertyvaluesthatdefinethereferentialconstraintsarenotconsistentbetweenprincipalanddependentobjectsinth

c# - 在 System.Type 上使用条件断点时出错

这是函数:publicvoidInit(System.TypeType){this.Type=Type;BuildFieldAttributes();BuildDataColumns(FieldAttributes);}我在第一行设置了一个断点(this.Type=Type),我想在Type.FullName=="Malt.Organisation"时中断这就是我输入的条件。但是当命中该行时会显示以下错误:Theconditionforabreakpointfailedtoexecute.Theconditionwas'Type.FullName=="Malt.Organisation

c# - 在 System.Type 上使用条件断点时出错

这是函数:publicvoidInit(System.TypeType){this.Type=Type;BuildFieldAttributes();BuildDataColumns(FieldAttributes);}我在第一行设置了一个断点(this.Type=Type),我想在Type.FullName=="Malt.Organisation"时中断这就是我输入的条件。但是当命中该行时会显示以下错误:Theconditionforabreakpointfailedtoexecute.Theconditionwas'Type.FullName=="Malt.Organisation

c# - 什么是以及如何修复 System.TypeInitializationException 错误?

privatestaticvoidMain(string[]args){stringstr=null;Logger.InitUserLogWithRotation();//当我构建项目时,它没有错误。但是当我执行它时,它总是中止。我尝试调试项目,但在第一行出现System.TypeInitializationException错误。我已经尝试谷歌搜索,但没有找到解决方案。似乎有任何变量初始化代码错误,但找不到它。请帮帮我。我是C#新手。谢谢。※这是Logger类代码publicclassLogger{privatestaticintHDLOG_PRIORITY_DEBUG=4;priv

c# - 什么是以及如何修复 System.TypeInitializationException 错误?

privatestaticvoidMain(string[]args){stringstr=null;Logger.InitUserLogWithRotation();//当我构建项目时,它没有错误。但是当我执行它时,它总是中止。我尝试调试项目,但在第一行出现System.TypeInitializationException错误。我已经尝试谷歌搜索,但没有找到解决方案。似乎有任何变量初始化代码错误,但找不到它。请帮帮我。我是C#新手。谢谢。※这是Logger类代码publicclassLogger{privatestaticintHDLOG_PRIORITY_DEBUG=4;priv

c# - 反射 - 从 System.Type 实例获取通用参数

如果我有以下代码:MyTypeanInstance=newMyType();Typetype=anInstance.GetType();如何通过查看类型变量找出实例化“anInstance”的类型参数?可能吗? 最佳答案 使用Type.GetGenericArguments.例如:usingSystem;usingSystem.Collections.Generic;publicclassTest{staticvoidMain(){vardict=newDictionary();Typetype=dict.GetType();Con

c# - 反射 - 从 System.Type 实例获取通用参数

如果我有以下代码:MyTypeanInstance=newMyType();Typetype=anInstance.GetType();如何通过查看类型变量找出实例化“anInstance”的类型参数?可能吗? 最佳答案 使用Type.GetGenericArguments.例如:usingSystem;usingSystem.Collections.Generic;publicclassTest{staticvoidMain(){vardict=newDictionary();Typetype=dict.GetType();Con

c# - 在 Entity Framework 中添加存储过程复杂类型

我正在尝试在EntityFramework中使用一个不返回任何内容的存储过程。我做了以下事情:添加了一个函数(右击存储过程->添加->函数导入->复杂类型->获取列信息->创建新的复杂类型)我的函数名称:summarySP_Result。构建项目后,Generated_code(BusinessAccount.web.g.cs)中未生成实体类但是表和View的实体类都是创建的,但存储过程也不创建。谁能说出为什么它不是在BusinessAccount.web.g.cs中生成的实体类?更新:让我确认在您的XXXXXX.web.g.cs类中创建的ReturnDataFromTemTable_