simple.odata.client

Simple Odata Client - How to add oAuth Token in each request header?

a 夏天 提交于 2019-12-22 00:56:30
问题 In Microsoft oData v4 proxy client, there is an option to add auth token into each request. It can be achieved by following way: var container = new Default.Container(new Uri(http://localhost:9000/)); //Registering the handle to the BuildingRequest event. container.BuildingRequest += (sender, e) => OnBuildingRequest(sender, e, accessToken); //Every time a OData request is build it adds an Authorization Header with the acesstoken private static void OnBuildingRequest(object sender,

CRM do not support direct update of Entity Reference properties, Use Navigation properties instead

北城以北 提交于 2019-12-21 10:47:03
问题 I am using Ms Dynamic Web Api with Simple OData. I need to add new record for link entities. I am using the below code snip and refer the documentation on https://github.com/object/Simple.OData.Client/wiki/Adding-entries-with-links var newContactData = await _oDataClient .For<Contacts>() .Set(new { firstname = contactData.ContatDetails.firstname, lastname = contactData.ContatDetails.lastname, emailaddress1 = contactData.ContatDetails.emailaddress1 }) .InsertEntryAsync(true); var

Simple Odata Client - How to add oAuth Token in each request header?

霸气de小男生 提交于 2019-12-04 20:33:30
In Microsoft oData v4 proxy client, there is an option to add auth token into each request. It can be achieved by following way: var container = new Default.Container(new Uri(http://localhost:9000/)); //Registering the handle to the BuildingRequest event. container.BuildingRequest += (sender, e) => OnBuildingRequest(sender, e, accessToken); //Every time a OData request is build it adds an Authorization Header with the acesstoken private static void OnBuildingRequest(object sender, BuildingRequestEventArgs e, TokenResponse token) { e.Headers.Add("Authorization", "Bearer " + token.AccessToken);

CRM do not support direct update of Entity Reference properties, Use Navigation properties instead

只谈情不闲聊 提交于 2019-12-04 04:15:42
I am using Ms Dynamic Web Api with Simple OData. I need to add new record for link entities. I am using the below code snip and refer the documentation on https://github.com/object/Simple.OData.Client/wiki/Adding-entries-with-links var newContactData = await _oDataClient .For<Contacts>() .Set(new { firstname = contactData.ContatDetails.firstname, lastname = contactData.ContatDetails.lastname, emailaddress1 = contactData.ContatDetails.emailaddress1 }) .InsertEntryAsync(true); var newContactLink = await _oDataClient.For<New_project_contactses>() .Set(new { _new_contact_project_name_new_value =