tôi tạo ra các đơn vị từ CRM như thế này:CRM Lấy thực thể - Lỗi: Không thể bỏ đối tượng của loại 'Microsoft.Xrm.Sdk.Entity' gõ 'CRMEntities.List'
CrmSvcUtil.exe /url:http://<servername>/<organizationname>/XRMServices/2011/Organization.svc
/out:<outputfilename>.cs /username:<username> /password:<password> /domain:<domainname>
/namespace:CRMEntities /serviceContextName:XrmServiceContext
Đối serviceContextName Tôi đặt XrmServiceContext. Tôi muốn lấy một số tổ chức từ CRM sử dụng mã tiếp theo:
var context = new XrmServiceContext(myorgserv);
var marketingList = context.ListSet.Where(item => item.Id == new Guid("SOME GUID"));
Và tôi nhận được lỗi:
Message "Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type 'CRMEntities.List'."
Sau 'thêm để xem' Tôi thấy rằng tất cả các tập hợp các thực trong bối cảnh có cùng một thông điệp. Tôi đã bỏ lỡ điều gì?
Cảm ơn bạn! Bị đập đầu vào tường, hoạt động hoàn hảo! –