NetCoreForce

A Salesforce REST API client library for .NET and C#

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

NetCoreForce lets .NET applications query, create, update and delete Salesforce records through the Salesforce REST API, with OAuth 2.0 login, SOQL and SOSL queries, composite requests, and strongly typed models for Salesforce objects.

NuGet Version NuGet Downloads

Install

dotnet add package NetCoreForce.Client
dotnet add package NetCoreForce.Models

Quick Start

// Log in with the OAuth Client Credentials flow
ForceClient client = await ForceClient.FromClientCredentialsAsync(
    "your-client-id", "your-client-secret", "https://your-domain.my.salesforce.com/services/oauth2/token");

// Query records
List<SfAccount> accounts = await client.Query<SfAccount>("SELECT Id, Name FROM Account LIMIT 10");
  • Authentication - Client Credentials, Web Server, refresh token, and other login flows
  • Examples - CRUD, queries, upserts, composite requests, search, metadata and more
  • API Reference - full ForceClient reference

Library Targets

The primary target is .NET Standard 2.0 to provide the widest possible support.

  • .NET Standard 2.0 for widest possible support including .NET Framework 4.6.2+
  • .NET Standard 2.1 for newer .NET Core versions

For more info on .NET Standard compatibility see the Microsoft documentation here

Full target list

  • .NET Standard 2.0
  • .NET Standard 2.1
  • .NET 8.0
  • .NET 9.0
  • .NET 10.0
  • .NET Framework 4.6.2
  • .NET Framework 4.7.2
  • .NET Framework 4.8
  • .NET Framework 4.8.1

All possible frameworks are specifically targeted so that conditional compilation can be done where required.

Full tested support is for .NET 8.0 - 10.0 as tooling and tests target those. Legacy .NET Frameworks are partially tested.

NuGet Packages

CHANGELOG

GitHub Repository

CI main: CI CI dev: CI

Projects in this solution

Designed to minimize dependencies

(Migration from Newtonsoft.Json to System.Text.Json is planned)

Feedback and suggestions welcome.

Licensed under the MIT license.