[英]new instance / constructor of Microsoft.Xrm.Sdk.DataCollection<T>
How to create a new instance of Microsoft.Xrm.Sdk.DataCollection<T>
class? 如何创建
Microsoft.Xrm.Sdk.DataCollection<T>
类的新实例? I've done it by following code, but it doesn't seem all right to me: 我已经通过以下代码完成了此操作,但对我来说似乎并不正确:
DataCollection<Entity> dc = (new EntityCollection()).Entities;
The Microsoft.Xrm.Sdk.DataCollection<T>
class does not have a public constructor, so you cannot use it the way you are showing. Microsoft.Xrm.Sdk.DataCollection<T>
类没有公共构造函数,因此您不能以显示方式使用它。
As an alternative you can design a collection class of your own and implement the ICollection<T>
interface or any other interface you need. 或者,您可以设计自己的集合类并实现
ICollection<T>
接口或所需的任何其他接口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.