类型 {1} 上不存在所需的属性 {0}。添加FK时实体框架(模型优先)

2024-01-03

我正在尝试将外键添加到数据库,然后更新模型。更新模型后,应用程序出现以下错误:

System.Data.Entity.Core.MetadataException was unhandled
  HResult=-2146232007
  Message=Schema specified is not valid. Errors: 
The relationship 'Accounting.Data.Repository.FK_np_DocumentStatuses_DocumentsTracking_StateId' was not loaded because the type 'Accounting.Data.Repository.DocumentsTracking' is not available.
The following information may be useful in resolving the previous error:
The required property 'DocumentsTrackingChildDocuments' does not exist on the type 'Accounting.Entity.DocumentsTracking'.


The relationship 'Accounting.Data.Repository.FK_np_DocumentsTracking_DocumentsTrackingChildDocuments_DocumentsTrackingId' was not loaded because the type 'Accounting.Data.Repository.DocumentsTracking' is not available.
The following information may be useful in resolving the previous error:
The required property 'DocumentsTrackingChildDocuments' does not exist on the type 'Accounting.Entity.DocumentsTracking'.


  Source=EntityFramework
  StackTrace:
       at System.Data.Entity.Core.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)
       at System.Data.Entity.Core.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)
       at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage)
       at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 logLoadMessage)
       at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly)
       at System.Data.Entity.Core.Metadata.Edm.MetadataOptimization.TryUpdateEntitySetMappingsForType(Type entityType)
       at System.Data.Entity.Internal.InternalContext.TryUpdateEntitySetMappingsForType(Type entityType)
       at System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType)
       at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
       at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
       at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
       at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Accounting.Data.Logic.OrdersLogic.getOrdersTmpList() in f:\proj\Accounting.Data.Logic\OrdersLogic.cs:line 16
       at Accounting.Data.Logic.OrdersLogic.RefreshDocumentsFromTmpOrders() in f:\proj\Accounting.Data.Logic\OrdersLogic.cs:line 22
       at Accounting.UI.MainForm.btnRefreshDocumentsFromOrderTmp_Click(Object sender, EventArgs e) in f:\proj\Accounting.UI\MainForm.cs:line 57
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Accounting.UI.Program.Main() in f:\proj\Accounting.UI\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

我的实体:

namespace Iwatch.Accounting.Entity
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Xml.Serialization;


    public partial class DocumentStatus 
    {
        public DocumentStatus()
        {
            this.Documents = new HashSet<Document>();
            this.DocumentsTrackings = new HashSet<DocumentsTracking>();
            this.DocumentsTrackingChildDocuments = new HashSet<DocumentsTrackingChildDocument>();
        }
        [XmlElement("StateId")]
        [Key] 
        public int StateId { get; set; }
        [XmlElement("StateName")]
        public string StateName { get; set; }
        [XmlElement("GroupId")]
        public Nullable<int> GroupId { get; set; }

        public virtual HashSet<Document> Documents { get; set; }
        public virtual HashSet<DocumentsTracking> DocumentsTrackings { get; set; }
        public virtual HashSet<DocumentsTrackingChildDocument> DocumentsTrackingChildDocuments { get; set; }
    }
}

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Iwatch.Accounting.Entity
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Globalization;
    using System.Xml.Serialization;

    public partial class DocumentsTracking
    {
        [XmlIgnore]
        CultureInfo culture = CultureInfo.CreateSpecificCulture("de-LI");

        [XmlIgnore]
        public int Id { get; set; }
        [Key]
        [XmlElement("Barcode")]
        public string Barcode { get; set; }
        [XmlElement("StateId")]
        public Nullable<int> StateId { get; set; }
        [XmlElement("StateName")]
        public string StateName { get; set; }
        [XmlElement("CheckWeight")]
        public Nullable<decimal> CheckWeight { get; set; }
        [XmlElement("DocumentCost")]
        public Nullable<decimal> DocumentCost { get; set; }

        [XmlIgnore]
        public DateTime? DateReceived { get; set; }

        [XmlElement("DateReceived")]
        public string DateReceivedString
        {
            get { return this.DateReceived != null ? this.DateReceived.Value.ToString("dd.MM.yyyy hh:mm:ss") : ""; }
            set { this.DateReceived = (value.Equals("") ? (DateTime?)null : System.DateTime.Parse(value, culture)); }
        }

        [XmlElement("RecipientFullName")]
        public string RecipientFullName { get; set; }
        [XmlElement("RecipientPost")]
        public string RecipientPost { get; set; }
        [XmlIgnore]
        public DateTime? ReceiptDateTime { get; set; }

        [XmlElement("ReceiptDateTime")]
        public string ReceiptDateTimeString
        {
            get { return this.ReceiptDateTime != null ? this.ReceiptDateTime.Value.ToString("yyyy-MM-dd hh:mm:ss") : ""; }
            set { this.ReceiptDateTime = (value.Equals("") ? (DateTime?)null : System.DateTime.Parse(value)); }
        }
        [XmlElement("OnlinePayment")]
        public Nullable<bool> OnlinePayment { get; set; }
        [XmlElement("DeliveryForm")]
        public Nullable<int> DeliveryForm { get; set; }
        [XmlElement("AddressUA")]
        public string AddressUA { get; set; }
        [XmlElement("AddressRU")]
        public string AddressRU { get; set; }
        [XmlElement("WareReceiverId")]
        public Nullable<int> WareReceiverId { get; set; }
        [XmlElement("BackDelivery")]
        public Nullable<int> BackDelivery { get; set; }
        [XmlElement("RedeliveryNUM")]
        public string RedeliveryNUM { get; set; }
        [XmlElement("CityReceiverSiteKey")]
        public Nullable<int> CityReceiverSiteKey { get; set; }
        [XmlElement("CityReceiverUA")]
        public string CityReceiverUA { get; set; }
        [XmlElement("CityReceiverRU")]
        public string CityReceiverRU { get; set; }
        [XmlElement("CitySenderSiteKey")]
        public Nullable<int> CitySenderSiteKey { get; set; }
        [XmlElement("CitySenderUA")]
        public string CitySenderUA { get; set; }
        [XmlElement("CitySenderRU")]
        public string CitySenderRU { get; set; }
        [XmlElement("DeliveryType")]
        public string DeliveryType { get; set; }
        [XmlElement("BackwardDeliveryNumber")]
        public System.Guid BackwardDeliveryNumber { get; set; }
        [XmlElement("RedeliveryCargoDescriptionMoney")]
        public string RedeliveryCargoDescriptionMoney { get; set; }
        [XmlElement("Failure")]
        public Nullable<bool> Failure { get; set; }
        [XmlElement("ReasonDescription")]
        public string ReasonDescription { get; set; }
        [XmlElement("GlobalMoneyExistDelivery")]
        public Nullable<bool> GlobalMoneyExistDelivery { get; set; }
        [XmlElement("GlobalMoneyLastTransactionStatus")]
        public string GlobalMoneyLastTransactionStatus { get; set; }
        [XmlIgnore]
        public DateTime? GlobalMoneyLastTransactionDate { get; set; }

        [XmlElement("GlobalMoneyLastTransactionDate")]
        public string GlobalMoneyLastTransactionDateString
        {
            get { return this.GlobalMoneyLastTransactionDate != null ? this.GlobalMoneyLastTransactionDate.Value.ToString("yyyy-MM-dd hh:mm:ss") : ""; }
            set { this.GlobalMoneyLastTransactionDate = (value.Equals("") ? (DateTime?)null : System.DateTime.Parse(value)); }
        }
        [XmlElement("Sum")]
        public Nullable<decimal> Sum { get; set; }
        [XmlElement("DocumentWeight")]
        public Nullable<decimal> DocumentWeight { get; set; }

        //TODO: the right data type is supposed to be used
        [XmlIgnore] //[XmlElement("SumBeforeCheckWeight")]
        public Nullable<decimal> SumBeforeCheckWeight { get; set; }
        [XmlElement("isEWPaid")]
        public Nullable<bool> isEWPaid { get; set; }
        [XmlElement("isEWPaidCashLess")]
        public Nullable<bool> isEWPaidCashLess { get; set; }
        [XmlElement("ewPaidSumm")]
        public Nullable<decimal> ewPaidSumm { get; set; }
        [XmlElement("RedeliverySum")]
        public Nullable<decimal> RedeliverySum { get; set; }
        [XmlElement("OwnerDocumentType")]
        public string OwnerDocumentType { get; set; }
        [XmlElement("errors")]
        public string errors { get; set; }
        [XmlElement("warnings")]
        public string warnings { get; set; }
        [XmlElement("info")]
        public string info { get; set; }

        public virtual DocumentStatus DocumentStatus { get; set; }
        public virtual DocumentsTrackingChildDocument DocumentsTrackingChildDocument { get; set; }
    }
}

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Iwatch.Accounting.Entity
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Xml.Serialization;

    public partial class DocumentsTrackingChildDocument
    {

        public int Id { get; set; }
        [XmlElement("DocumentsTrackingId")]
        [Key]
        public Nullable<int> DocumentsTrackingId { get; set; }
        [XmlElement("Barcode")]
        public string Barcode { get; set; }
        [XmlElement("StateId")]
        public Nullable<int> StateId { get; set; }
        [XmlElement("StateName")]
        public string StateName { get; set; }
        [XmlElement("CheckWeight")]
        public Nullable<decimal> CheckWeight { get; set; }
        [XmlElement("DocumentCost")]
        public Nullable<decimal> DocumentCost { get; set; }
        [XmlElement("DateReceived")]
        public Nullable<System.DateTime> DateReceived { get; set; }
        [XmlElement("RecipientFullName")]
        public string RecipientFullName { get; set; }
        [XmlElement("RecipientPost")]
        public string RecipientPost { get; set; }
        [XmlElement("ReceiptDateTime")]
        public Nullable<System.DateTime> ReceiptDateTime { get; set; }
        [XmlElement("OnlinePayment")]
        public Nullable<bool> OnlinePayment { get; set; }
        [XmlElement("DeliveryForm")]
        public string DeliveryForm { get; set; }
        [XmlElement("AddressUA")]
        public string AddressUA { get; set; }
        [XmlElement("AddressRU")]
        public string AddressRU { get; set; }
        [XmlElement("WareReceiverId")]
        public Nullable<int> WareReceiverId { get; set; }
        [XmlElement("BackDelivery")]
        public string BackDelivery { get; set; }
        [XmlElement("RedeliveryNUM")]
        public string RedeliveryNUM { get; set; }
        [XmlElement("CityReceiverSiteKey")]
        public string CityReceiverSiteKey { get; set; }
        [XmlElement("CityReceiverUA")]
        public string CityReceiverUA { get; set; }
        [XmlElement("CityReceiverRU")]
        public string CityReceiverRU { get; set; }
        [XmlElement("CitySenderSiteKey")]
        public string CitySenderSiteKey { get; set; }
        [XmlElement("CitySenderUA")]
        public string CitySenderUA { get; set; }
        [XmlElement("CitySenderRU")]
        public string CitySenderRU { get; set; }
        [XmlElement("DeliveryType")]
        public string DeliveryType { get; set; }
        [XmlElement("BackwardDeliveryNumber")]
        public System.Guid BackwardDeliveryNumber { get; set; }
        [XmlElement("RedeliveryCargoDescriptionMoney")]
        public string RedeliveryCargoDescriptionMoney { get; set; }
        [XmlElement("Failure")]
        public Nullable<bool> Failure { get; set; }
        [XmlElement("ReasonDescription")]
        public string ReasonDescription { get; set; }
        [XmlElement("GlobalMoneyExistDelivery")]
        public Nullable<bool> GlobalMoneyExistDelivery { get; set; }
        [XmlElement("GlobalMoneyLastTransactionStatus")]
        public string GlobalMoneyLastTransactionStatus { get; set; }
        [XmlElement("GlobalMoneyLastTransactionDate")]
        public Nullable<System.DateTime> GlobalMoneyLastTransactionDate { get; set; }
        [XmlElement("Sum")]
        public Nullable<decimal> Sum { get; set; }
        [XmlElement("DocumentWeight")]
        public Nullable<decimal> DocumentWeight { get; set; }
        [XmlElement("SumBeforeCheckWeight")]
        public Nullable<decimal> SumBeforeCheckWeight { get; set; }
        [XmlElement("isEWPaid")]
        public Nullable<bool> isEWPaid { get; set; }
        [XmlElement("isEWPaidCashLess")]
        public Nullable<bool> isEWPaidCashLess { get; set; }
        [XmlElement("ewPaidSumm")]
        public Nullable<decimal> ewPaidSumm { get; set; }
        [XmlElement("RedeliverySum")]
        public Nullable<decimal> RedeliverySum { get; set; }
        [XmlElement("OwnerDocumentType")]
        public string OwnerDocumentType { get; set; }

        public virtual DocumentStatus DocumentStatus { get; set; }
        public virtual DocumentsTracking DocumentsTracking { get; set; }
    }
}

我想念什么?


属性类型错误。使用确切的类型修改您的实体。DocumentsTrackingChildDocuments不等于DocumentsTrackingChildDocument.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

类型 {1} 上不存在所需的属性 {0}。添加FK时实体框架(模型优先) 的相关文章

  • 在 Xamarin Android 中将图像从 URL 异步加载到 ImageView 中

    我有一个包含多个项目的 ListView 列表中的每个项目都应该有一个与之关联的图像 我创建了一个数组适配器来保存每个列表项并具有我希望加载的图像的 url 我正在尝试使用 Web 请求异步加载图像 并设置图像并在加载后在视图中更新它 但视
  • 如何在C++中实现模板类协变?

    是否可以以这样一种方式实现类模板 如果模板参数相关 一个对象可以转换为另一个对象 这是一个展示这个想法的例子 当然它不会编译 struct Base struct Derived Base template
  • 如何在没有 Control.Invoke() 的情况下从后台线程修改控件属性

    最近 我们遇到了一些旧版 WinForms 应用程序 我们需要更新一些新功能 在专家测试该应用程序时 发现一些旧功能被破坏 无效的跨线程操作 现在 在您认为我是新手之前 我确实有一些 Windows 窗体应用程序的经验 我不是专家 但我认为
  • 嵌入式系统中的malloc [重复]

    这个问题在这里已经有答案了 我正在使用嵌入式系统 该应用程序在 AT91SAMxxxx 和 cortex m3 lpc17xxx 上运行 我正在研究动态内存分配 因为它会极大地改变应用程序的外观 并给我更多的力量 我认为我唯一真正的路线是为
  • 写入和读取文本文件 - C# Windows 通用平台应用程序 Windows 10

    有用 但在显示任何内容之前 您必须在文本框中输入内容 我想那是因为我使用了 TextChanged 事件处理程序 如果我希望它在没有用户交互的情况下显示文本文件的内容 我应该使用哪个事件处理程序 因此 我想在按下按钮时将一些数据写入 C W
  • 使用 Google Analytics API 在 C# 中显示信息

    我一整天都在寻找一个好的解决方案 但谷歌发展得太快了 我找不到有效的解决方案 我想做的是 我有一个 Web 应用程序 它有一个管理部分 用户需要登录才能查看信息 在本节中 我想显示来自 GA 的一些数据 例如某些特定网址的综合浏览量 因为我
  • c 中的错误:声明隐藏了全局范围内的变量

    当我尝试编译以下代码时 我收到此错误消息 错误 声明隐藏了全局范围内的变量 无效迭代器 节点 根 我不明白我到底在哪里隐藏或隐藏了之前声明的全局变量 我怎样才能解决这个问题 typedef node typedef struct node
  • Windows 窗体不会在调试模式下显示

    我最近升级到 VS 2012 我有一组在 VS 2010 中编码的 UI 测试 我试图在 VS 2012 中启动它们 我有一个 Windows 窗体 在开始时显示使用 AssemblyInitialize 属性运行测试 我使用此表单允许用户
  • 如何在 Team Foundation 上强制发表有意义的签入评论?

    我有一个开发团队有一个坏习惯 他们写道poor签入评论 当我们必须在团队基础上查看文件的历史记录时 这使得它成为一场噩梦 我已经启用了变更集评论政策 这样他们甚至可以在签到时留下评论 否则他们不会 我们就团队的工作质量进行了一些讨论 他们很
  • *.tlb 文件在运行时使用过吗?

    我正在开发一个通过 COM 互操作公开一些 NET API 的产品 作为构建的一部分 我们为所有此类程序集生成 tlb 文件 并将它们作为单独 SDK 包的一部分提供 我们的客户可以在我们的产品之上安装 SDK 并创建使用我们的 COM A
  • 实体框架 - 选择特定列并返回强类型而不丢失强制类型转换

    我正在尝试做类似的事情这个帖子 https stackoverflow com questions 1094931 linq to sql how to select specific columns and return strongly
  • 在 URL 中发送之前对特殊字符进行百分比编码

    我需要传递特殊字符 如 等 Facebook Twitter 和此类社交网站的 URL 为此 我将这些字符替换为 URL 转义码 return valToEncode Replace 21 Replace 23 Replace 24 Rep
  • char指针或char变量的默认值是什么[重复]

    这个问题在这里已经有答案了 下面是我尝试打印 char 变量和指针的默认值 值的代码 但无法在控制台上看到它 它是否有默认值或只是无法读取 ASCII 范围 include
  • 已过时 - OpenCV 的错误模式

    我正在使用 OpenCV 1 进行一些图像处理 并且对 cvSetErrMode 函数 它是 CxCore 的一部分 感到困惑 OpenCV 具有三种错误模式 叶 调用错误处理程序后 程序终止 Parent 程序没有终止 但错误处理程序被调
  • Bing 地图运行时错误 Windows 8.1

    当我运行带有 Bing Map 集成的 Windows 8 1 应用程序时 出现以下错误 Windows UI Xaml Markup XamlParseException 类型的异常 发生在 DistanceApp exe 中 但未在用户
  • 窗体最大化时自动缩放子控件

    有没有办法在最大化屏幕或更改分辨率时使 Windows 窗体上的所有内容自动缩放 我发现手动缩放它是正确的 但是当切换分辨率时我每次都必须更改它 this AutoScaleDimensions new System Drawing Siz
  • 如何使用 ReactiveList 以便在添加新项目时更新 UI

    我正在创建一个带有列表的 Xamarin Forms 应用程序 itemSource 是一个reactiveList 但是 向列表添加新项目不会更新 UI 这样做的正确方法是什么 列表定义 listView new ListView var
  • 如何在 C# 中播放在线资源中的 .mp3 文件?

    我的问题与此非常相似question https stackoverflow com questions 7556672 mp3 play from stream on c sharp 我有音乐网址 网址如http site com aud
  • 将变量分配给另一个变量,并将一个变量的更改反映到另一个变量中

    是否可以将一个变量分配给另一个变量 并且当您更改第二个变量时 更改会瀑布式下降到第一个变量 像这样 int a 0 int b a b 1 现在 b 和 a 都 1 我问这个问题的原因是因为我有 4 个要跟踪的对象 并且我使用名为 curr
  • 如何将字符串“07:35”(HH:MM) 转换为 TimeSpan

    我想知道是否有办法将 24 小时时间格式的字符串转换为 TimeSpan 现在我有一种 旧时尚风格 string stringTime 07 35 string values stringTime Split TimeSpan ts new

随机推荐

  • 如何从 .gitignore 中列出的存储库中删除文件而不更改空格

    我已经阅读了如何使用 git 命令从存储库中删除忽略文件中的文件 将目录添加到 gitignore 后从远程存储库中删除它们 https stackoverflow com questions 7927230 remove director
  • 如何在url中显示用户名

    谁能告诉我如何在 URL 中显示用户名 如果名称在 URL 中传递 username GET username echo Welcome back username 我想显示像 www example com 用户名 当他登录时 如何在用户
  • 如何仅重试 RxJs 中可观察源发出的某些错误

    srcObservable retry 将捕获 srcObservable 发出的错误并重新订阅 srcObservable 无论错误的类型如何 然而 在某些情况下 只希望重试 srcObservable 发出的某些类型的错误 有没有办法在
  • 将具有多个句子的字符串中句子的第一个单词大写

    eg String s 这是a line is over 应该出来为 这是一条线 结束了 我想过两次使用字符串标记器 first split using second split using to get the first word th
  • 对于“Pentium4 及以上”处理器,gcc 的最佳 March 和 mtune 选项是什么

    我的 C 应用程序 使用 g 编译 需要在 Pentium 4 32 位 及更 高版本上运行 但是 它通常与 Core2Duo 或更好的处理器一起使用 我目前正在使用 march pentium4 mtune pentium4 但一些阅读促
  • ggplot结果输出为一份pdf文件,但在R中输出几页

    我至少有 10 个 ggplot 绘图 我们可以称它们为plot1 plot2 我可以将它们输出到单独的 pdf 文件中 但我更喜欢只将它们输出到一个 pdf 文件中 而不是几页 一页 来自 ggplot 的一个图 我尝试列出所有绘图并使用
  • 如何监控Python文件的变化?

    如果代码发生更改 我想重新启动我的 Python Web 应用程序 但是可能有大量文件可以更改 因为导入模块中的文件可能会更改 如何从导入的包 模块中获取实际的文件名 如何高效检测修改过的Python文件 有图书馆可以做到这一点吗 无耻的插
  • 从大表中删除大量记录的有效方法

    我想从 MySql 数据库中的大表 500K 记录 中删除大量记录 200K 我想让这个调用尽可能高效 因为我不希望数据库在执行调用时变得 无响应 我需要删除 早于 10 天的记录 根据created at列 目前我使用 delete fr
  • 无法在 github 操作中获取发布标题

    我添加了 github 操作 该操作会在每次发布时在我们的 slack 通道上发送一条消息 我已经设法从 github 上下文获取仓库名称和标签 https docs github com en actions learn github a
  • 502 - Web 服务器在充当网关或代理服务器时收到无效响应

    当我将应用程序发布到 Azure 网站时 我收到标题错误 但没有任何效果 这不是暂时的 我研究了一下 看起来它与人们遇到的错误问题无关 我启用了日志记录 但没有得到太多重要的输出 日志说 2014 01 15 10 56 26 1MANDO
  • 如何在RecyclerView中实现部分可见的下一项

    我使用 onFling 一次滚动一个项目 并且希望只有一个项目在页面上完全可见 而下一个项目部分可见 我想要这个 我怎样才能在RecyclerView中实现这个目标 这是适配器代码 只是代替了cardView 如图所示 它是imageVie
  • 使用选项卡按钮重新输入后 DataGrid CurrentItem != SelectedItem

    这个简单的 WPF DataGrid
  • JavaScript 中可链接的、基于 Promise 的类接口

    我正在用 JavaScript 编写一个构造函数 它具有以下属性 function WhizBang var promise this publicMethod One function publicMethod One this publ
  • 允许用户从 TableView 复制数据

    我有一个简单的 JavaFX 应用程序 允许用户查询数据库并查看表中的数据 我希望用户能够单击表格单元格 并使用标准剪贴板按键将文本从该单元格复制到剪贴板 对于 Win Linux 为 ctrl c 对于 Mac 为 cmd c 仅供参考
  • 从 Angular 2 服务创建并返回 Observable

    这更多的是一个 最佳实践 问题 共有三名玩家 aComponent a Service and a Model The Component正在呼叫Service从数据库获取数据 这Service正在使用 this people http g
  • React redux oop 类

    来自角度 我曾经为数据库中的每个实体都有一个类 这样的类封装了所有实体行为 例如用户类可以看起来像 export class User static notValid u return u id u id gt 0 u fullname u
  • 关于多线程下载的缺点

    我有一个关于多线程下载的问题 正如您所知 使用多个线程下载可以提高应用程序的性能 但是有一些措施需要尊重 例如线程数 可用带宽等等 但我不太明白 为什么例如 使用多个线程可能会降低应用程序的性能 或者服务器的带宽 质量如何影响多线程应用程序
  • 如何将docker镜像打包到一个文件中

    我有一个名为 ubuntu dev update 15 的 5GB docker 镜像 它是我在本地 Ubuntu 14 开发机器上开发的 在该图像中 我拥有完成开发工作所需的一切 现在我需要能够将此映像发送到不同的 Linux 主机 这样
  • 有没有办法检查计算机的 AD 组成员身份?

    我正在尝试通过 Powershell 检查计算机组成员身份 我希望能够指定某个计算机名称并通过 Powershell 脚本查找该计算机所在的组 我计划在计算机上运行脚本 获取主机名 然后打印出该计算机所在的 AD 组 有没有一种简单的方法可
  • 类型 {1} 上不存在所需的属性 {0}。添加FK时实体框架(模型优先)

    我正在尝试将外键添加到数据库 然后更新模型 更新模型后 应用程序出现以下错误 System Data Entity Core MetadataException was unhandled HResult 2146232007 Messag