无法将项添加到固定大小的数组异常 [英] An item cannot be added to a fixed size Array exception
问题描述
大家好,
当尝试通过wcf服务将具有引用属性的实体添加到另一个实体时,会抛出以下异常:
When trying to add an entity that has a reference property to another entity via a wcf service, the following exception is being thrown:
用户代码未处理System.Data.EntityException
Message =无法在实体类型SAG.Taskflow.Common.Model.WorkflowType上设置字段/属性WorkflowInstances。有关详细信息,请参阅InnerException。
Source = System.Data.Entity
System.Data.EntityException was unhandled by user code
Message=Unable to set field/property WorkflowInstances on entity type SAG.Taskflow.Common.Model.WorkflowType. See InnerException for details.
Source=System.Data.Entity
WorkflowInstance是使用WorkflowType属性添加的实体的类型。 WorkflowType具有 ICollection< WorkflowInstance>属性。
the WorkflowInstance is the type of the entity that is being added with a WorkflowType property. WorkflowType has a ICollection<WorkflowInstance> property.
请注意,第一次添加项目不会引发问题, ICollection< WorkflowInstance>正确设置了WorkflowType。但是当第二次添加实例时,会抛出异常。
Note that adding the item the first time doesn't raise the problem, the ICollection<WorkflowInstance> of the WorkflowType is being set correctly. But when adding the instance the second time, the exception is being thrown.
推荐答案
请你在这里发一些代码吗?
Could you please post some code here?
这篇关于无法将项添加到固定大小的数组异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!