TimHanewich.Cds 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package TimHanewich.Cds --version 0.2.1                
NuGet\Install-Package TimHanewich.Cds -Version 0.2.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TimHanewich.Cds" Version="0.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TimHanewich.Cds --version 0.2.1                
#r "nuget: TimHanewich.Cds, 0.2.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TimHanewich.Cds as a Cake Addin
#addin nuget:?package=TimHanewich.Cds&version=0.2.1

// Install TimHanewich.Cds as a Cake Tool
#tool nuget:?package=TimHanewich.Cds&version=0.2.1                

TimHanewich.Cds

A lightweight library for interacting with Microsoft's Common Data Service (CDS), the native data storage service of Microsoft's Power Platform and Dynamics 365 platform.

This library alleviates the need to create custom HTTP requests to interact with the CDS. After providing the service with a few parameters, you can easily interact with the CDS through the traditional CRUD operators.

Initializing the CDS Service

Place the following import statements at the top of your code file.

using TimHanewich.Cds;  
using Newtonsoft.Json;  
using Newtonsoft.Json.Linq;

Create a new CDS Service

CdsService cds = new CdsService("YourOrgName", "YourAccessToken");

In the above example, replace "YourOrgName" with the organization name for your environment. For example, if your environment URL is https://org109a2adc0.crm.dynamics.com/, your org name is "org109a2adc0".

Also replace "YourAccessToken" with the access token that you have received after authenticating a user via an OAuth flow. Instructions on how to do this can be found in https://github.com/TimHanewich/Microsoft-Graph-Example/blob/master/CommonDataServiceExample.cs

Creating a record

We will use the CreateRecordAsync method of the CdsService to create a new record. This method accepts two parameters:
setter - the setter (schema) name of the entity. This can be found by going to https://<your_org_name>.crm.dynamics.com/api/data/v9.0/ in an authenticated window.
object_json - The JSON content of the record that you are creating.

A complete example of initializing a CDS Service and creating a new account record:

CdsService cds = new CdsService("YourOrgName", "YourAccessToken");
await cds.CreateRecordAsync("accounts", "{\"name\":\"123 Industries\"}");

Reading, Updating, and Deleting

The reading, updating, and deleting methods are very similar to the CreateRecordAsync method that is detailed above. The only difference is that these three methods also have a parameter called id which serves as the unique identifier of the record that you are trying to transact on.
This id parameter is the GUID value associated with the record that you can find in Dynamics 365 or the Power Platform CDS portal.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.5.0 265 3/23/2023 2.5.0 is deprecated because it is no longer maintained.
2.4.1 213 3/21/2023
2.4.0 249 3/21/2023
2.3.0 218 3/21/2023
2.2.0 220 3/20/2023
2.1.0 218 3/20/2023
2.0.0 439 3/18/2022
1.0.0 411 3/15/2022
0.10.0 323 9/16/2021
0.9.0 364 5/6/2021
0.8.0 311 4/29/2021
0.7.0 299 4/29/2021
0.6.0 297 4/28/2021
0.5.0 326 4/24/2021
0.4.0 324 4/22/2021
0.3.1 330 4/20/2021
0.3.0 329 4/9/2021
0.2.1 459 9/18/2020
0.2.0 447 9/18/2020
0.1.0 426 9/14/2020