c# - How do I add an Interface to a MS Proxy Class for MS-CRM 2013 -
so have ms dynamics crm 2013 installation i'm trying integrate items , want send data. have interface (iaccnt) want apply proxy class generated when added service refrence ...xrmservices/2011/organizationdata.svc/ (i added on partial class)
when added interface (it had "name" , "accountnumber") going along (i.e. able save items) ... added new item interface didn't have direct corollary ("email") did map (so getter , setter passed data , this.emailaddress1)
with change following error on save: error processing request stream. property name 'email' specified type 'microsoft.crm.sdk.data.services.account' not valid.
this unexpected i'm sending microsoft.crm.sdk.data.services.account object shouldn't have email on it? , regardless should able send more information needed? there need able add interface proxy class , have save still work?
i've tried adding [xmlignore] , [ignoredatamember] on public property implementation of email, same result ... (i.e. "ignore these properties when ".addtoaccountset"/".savechanges()" solve isssue?
interface code
public interface imyaccount { string name { get; set; } string email { get; set; } }
partial class (partial on proxy class created service reference)
namespace mynamespace.customerrelationshipmanagement.microsoftdynamics.crmservicereference { public partial class account : mynamespace.interfaces.imyaccount { public string email { { return this.emailaddress1; } set { this.emailaddress1 = value; } } } }
where error raised (attempt add account)
var crmuri = new uri("http://crminstallation/xrmservices/2011/organizationdata.svc/"); var crmservice = new crmservicereference.crminstallationcontext(crmuri); crmservice.credentials = system.net.credentialcache.defaultcredentials; var crmmyaccount = new crmservicereference.account(); crmmyaccount.name = "test account"; crmmyaccount.email = "myemail@mydomain.com"; crmservice.addtoaccountset(crmmyaccount); crmservice.savechanges();
if email removed interface , partial class works (in saves new account crm)
the account entity has no email field. has emailaddress1 1 though, try that
Comments
Post a Comment