Contact crmContact = xrm.ContactSet.Where(x => x.ContactId == contactId).SingleOrDefault();crmContact.assigned_clinic;- Id (the Guid of the entity that it refers
First o= new DAL.SMSModel.OmidPaymakEntities();这个id我的错误帮助了我
无法将对象添加到EntityCollection或EntityReference附着到ObjectContext的对象不能添加到未与源对象关联的EntityCollection或EntityReference。