All Projects → anthonyreilly → NetCoreForce

anthonyreilly / NetCoreForce

Licence: MIT license
Salesforce REST API toolkit for .NET Standard and .NET Core

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to NetCoreForce

apex-fp
Functional programming for Salesforce Apex
Stars: ✭ 231 (+200%)
Mutual labels:  salesforce, forcedotcom, salesforce-api
ssjs-lib
An open-source library that takes the repetitive and complex tasks and simplifies them, enabling you to get the most out of Salesforce Marketing Cloud.
Stars: ✭ 28 (-63.64%)
Mutual labels:  salesforce, salesforce-api
HTTPCalloutFramework
HTTP Callout Framework - A light weight callout framework for apex HTTP callouts in Salesforce
Stars: ✭ 43 (-44.16%)
Mutual labels:  salesforce, salesforce-api
Salesforce-Short-Hands
The main purpose of this repository is to put all the utilities in one place so that other developers can get help and they can also contribute to this repo.
Stars: ✭ 31 (-59.74%)
Mutual labels:  salesforce, salesforce-api
NebulaFramework
A development framework for Salesforce's Apex language & the Force.com platform
Stars: ✭ 28 (-63.64%)
Mutual labels:  salesforce, forcedotcom
apex-tmLanguage
Salesforce Apex Language syntax grammar used for colorization
Stars: ✭ 27 (-64.94%)
Mutual labels:  salesforce
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-85.71%)
Mutual labels:  dotnet-standard
basket
Mozilla's email newsletter subscription management API service
Stars: ✭ 12 (-84.42%)
Mutual labels:  salesforce
uswds-sf-lightning-community
A Salesforce Lightning Community Theme and related components built upon US Web Design System
Stars: ✭ 24 (-68.83%)
Mutual labels:  salesforce
sfdx-flowdoc-plugin
A Salesforce CLI plugin that generates design document from Lightning Flow (currently Process Builder) metadata
Stars: ✭ 56 (-27.27%)
Mutual labels:  salesforce
one-pub-sub-lwc
One PubSub: A Declarative PubSub Library for Lightning Web Component and Aura Component
Stars: ✭ 19 (-75.32%)
Mutual labels:  salesforce
Apex-Code-Conventions
Apex conventions and best practices for Salesforce Developers
Stars: ✭ 28 (-63.64%)
Mutual labels:  salesforce
salesforce-iam-flows
Node.js application that implements some of the most common SAML and OAuth flows in Salesforce.
Stars: ✭ 31 (-59.74%)
Mutual labels:  salesforce
apex-dml-mocking
DML mocking, CRUD mocking, dependency injection framework for Salesforce.com (SFDC) using Apex
Stars: ✭ 38 (-50.65%)
Mutual labels:  salesforce
RESTCountries.NET
.NET Standard wrapper library around the API provided by REST Countries https://restcountries.com. The world in .NET 🔥.
Stars: ✭ 33 (-57.14%)
Mutual labels:  dotnet-standard
lwc-modules
Build any LWC you want without ever having to touch Apex
Stars: ✭ 20 (-74.03%)
Mutual labels:  salesforce
LiteNetwork
A simple and fast .NET networking library compatible with .NET Standard 2, .NET 5, 6 and 7.
Stars: ✭ 66 (-14.29%)
Mutual labels:  dotnet-standard
NwRfcNet
An easy way of making SAP RFC calls from .NET Core
Stars: ✭ 83 (+7.79%)
Mutual labels:  dotnet-standard
rvw developers core
SFCC Developers Core Cartridge. A Salesforce Commerce Cloud (Demandware) Cartridge for Developers.
Stars: ✭ 43 (-44.16%)
Mutual labels:  salesforce
FuelSDK-Node-REST
Node REST client w/ auth to access the Salesforce Marketing Cloud (formerly ExactTarget) API
Stars: ✭ 29 (-62.34%)
Mutual labels:  salesforce

NetCoreForce

A .NET Standard and .NET Core Salesforce REST API toolkit and API wrapper

This project is not offered, sponsored, or endorsed by Salesforce.

CHANGELOG

CI main:

CI dev:

NetCoreForce v3 currently targeting netstandard 2.0 & 2.1, supports .NET Core 2.1,3.1, and 6.0 apps.

For .NET Core 1.x support, use NetCoreForce v2.7

Projects in this solution:

NuGet Packages

An effort is made to minimize the dependencies:

Experimental Projects:

Feedback and suggestions welcome.

Licensed under the MIT license.

Basic Usage Example

///Initialize the authentication client
AuthenticationClient auth = new AuthenticationClient();

//Pass in the login information
await auth.UsernamePasswordAsync("your-client-id", "your-client-secret", "your-username", "your-password", "token-endpoint-url");

//the AuthenticationClient object will then contain the instance URL and access token to be used in each of the API calls
ForceClient client = new ForceClient(auth.AccessInfo.InstanceUrl, auth.ApiVersion, auth.AccessInfo.AccessToken);

//Retrieve an object by Id
SfAccount acct = await client.GetObjectById<SfAccount>(SfAccount.SObjectTypeName, "001i000002C8QTI");
//Modify the record and update
acct.Description = "Updated Description";
await client.UpdateRecord<SfAccount>(SfAccount.SObjectTypeName, acct.Id, acct);
//Delete the record
await client.DeleteRecord(SfAccount.SObjectTypeName, acct.Id);

//Get the results of a SOQL query
List<SfCase> cases = await client.Query<SfCase>("SELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case");

Nested Query Results

When you include related objects in a SOQL query:

SELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case

And get the results via the client, you can then access the related objects and fields included in the query in a fluent manner.

List<SfCase> cases = await client.Query<SfCase>("SELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case");
SfCase firstCase = cases[0];
string caseNumber = firstCase.CaseNumber;
string caseAccountName = firstCase.Account.Name;
string caseContactName = firstCase.Contact.Name;

Nested queries are not fully supported - the subquery results will not be complete if they exceed the batch size as the NextRecordsUrl in the subquery results is not being acted upon. Instead use the relationship syntax in the example above.

// *NOT* fully supported
"SELECT Id,CaseNumber, (Select Contact.Name from Account) FROM Case"

Asynchronous Batch Processing

Query method will retrieve the full result set before returning. By default, results are returned in batches of 2000. In cases where you are working with large result sets, you may want to use QueryAsync to retrieve the batches asynchronously for better performance.

// First create the async enumerable. At this point, no query has been executed.
// batchSize can be omitted to use the default (usually 2000), or given a custom value between 200 and 2000.
IAsyncEnumerable<SfContact> contactsEnumerable = client.QueryAsync<SfContact>("SELECT Id, Name FROM Contact ", batchSize: 200);

// Get the enumerator, in a using block for proper disposal
await using (IAsyncEnumerator<SfContact> contactsEnumerator = contactsEnumerable.GetAsyncEnumerator())
{
    // MoveNext() will execute the query and get the first batch of results.
    // Once the inital result batch has been exhausted, the remaining batches, if any, will be retrieved.
    while (await contactsEnumerator.MoveNextAsync())
    {
        SfContact contact = contactsEnumerator.Current;
        // process your results
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].