{"id":19100203,"url":"https://github.com/anthonyreilly/NetCoreForce","last_synced_at":"2025-04-18T17:33:03.341Z","repository":{"id":20537722,"uuid":"89884787","full_name":"anthonyreilly/NetCoreForce","owner":"anthonyreilly","description":"Salesforce REST API toolkit for .NET Standard and .NET Core","archived":false,"fork":false,"pushed_at":"2024-07-06T00:49:48.000Z","size":1009,"stargazers_count":110,"open_issues_count":24,"forks_count":64,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-31T02:52:04.634Z","etag":null,"topics":["dotnet","dotnet-core","dotnet-standard","force","forcedotcom","netcoreapp","salesforce","salesforce-api"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthonyreilly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-01T00:05:46.000Z","updated_at":"2024-10-13T15:42:04.000Z","dependencies_parsed_at":"2023-11-22T17:31:02.135Z","dependency_job_id":"f4d54b09-02d5-40e2-9e42-a312666314e3","html_url":"https://github.com/anthonyreilly/NetCoreForce","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyreilly%2FNetCoreForce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyreilly%2FNetCoreForce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyreilly%2FNetCoreForce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyreilly%2FNetCoreForce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonyreilly","download_url":"https://codeload.github.com/anthonyreilly/NetCoreForce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223630357,"owners_count":17176322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnet-core","dotnet-standard","force","forcedotcom","netcoreapp","salesforce","salesforce-api"],"created_at":"2024-11-09T03:52:33.988Z","updated_at":"2025-04-18T17:33:03.334Z","avatar_url":"https://github.com/anthonyreilly.png","language":"C#","funding_links":[],"categories":["dotnet"],"sub_categories":[],"readme":"# NetCoreForce \n\n## A .NET Standard and .NET Core Salesforce REST API toolkit and API wrapper\n*This project is not offered, sponsored, or endorsed by Salesforce.*\n\n### [CHANGELOG](CHANGELOG.md)  \n\nCI main:  \n[![](https://github.com/anthonyreilly/NetCoreForce/workflows/CI/badge.svg?branch=main)](https://github.com/anthonyreilly/NetCoreForce/actions?query=workflow%3ACI+branch%3Amain)  \nCI dev:  \n[![](https://github.com/anthonyreilly/NetCoreForce/workflows/CI/badge.svg?branch=dev)](https://github.com/anthonyreilly/NetCoreForce/actions?query=workflow%3ACI+branch%3Adev)  \n\nNetCoreForce v4 currently targeting netstandard 2.0 \u0026 2.1, supports .NET Core 2.1,3.1,6.0, and 7.0 apps.\n\nFor .NET Core 1.x support, use NetCoreForce v2.7\n\n### Projects in this solution:\n* [NetCoreForce.Client](src/NetCoreForce.Client)\n    - Main library  \n* [NetCoreForce.Client.Tests](src/NetCoreForce.Client.Tests)\n    - Unit tests (offline/mocked)  \n* [NetCoreForce.FunctionalTests](src/NetCoreForce.FunctionalTests)\n    - Online Unit tests (Needs valid login credentials)  \n* [NetCoreForce.ModelGenerator](src/NetCoreForce.ModelGenerator)\n    - Check [README](src/NetCoreForce.ModelGenerator/README.md) for docs\n    - Optional custom dotnet-cli tool for code generation of custom objects/fields.  \n* [NetCoreForce.Models](src/NetCoreForce.Models)\n    - Check [README](src/NetCoreForce.Models/README.md) for docs\n    - Optional library with a set of pre-generated standard models  \n* [SampleConsole](src/SampleConsole)\n    - A simple .NET Core console app to demonstrate the library.\n\n### NuGet Packages\n* [NetCoreForce.Client](https://www.nuget.org/packages/NetCoreForce.Client/)\n* [NetCoreForce.Models](https://www.nuget.org/packages/NetCoreForce.Models/)\n* [NetCoreForce.ModelGenerator](https://www.nuget.org/packages/NetCoreForce.ModelGenerator/)\n\n### An effort is made to minimize the dependencies:\n* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) (JSON Serialization)\n* [System.Text.Encodings.Web](https://www.nuget.org/packages/System.Text.Encodings.Web) (URL formatting)\n* [Microsoft.Bcl.AsyncInterfaces](https://www.nuget.org/packages/Microsoft.Bcl.AsyncInterfaces/)\n    - Only included in .netstandard2.0, .netcoreapp2.0 targets\n    - Provides await using, async disposables\n\n### Experimental Projects:\n* Please note: The LINQ library has barely been tested, and is not recommended for production use. Consider it an alpha release.\n* [NetCoreForce.Linq](src/NetCoreForce.Linq) - an experimental LINQ-to-SOQL query provider\n* [NetCoreForce.Linq.Tests](src/NetCoreForce.Linq.Tests) - LINQ Unit tests (offline/mocked)\n* NuGet package: [NetCoreForce.Linq](https://www.nuget.org/packages/NetCoreForce.Linq/)\n* Retains a dependency on [System.Interactive.Async](https://www.nuget.org/packages/System.Interactive.Async/)\n\n\nFeedback and suggestions welcome.\n\nLicensed under the MIT license.\n\n\n### Basic Usage Example\n\n```csharp\n///Initialize the authentication client\nAuthenticationClient auth = new AuthenticationClient();\n\n//Pass in the login information\nawait auth.UsernamePasswordAsync(\"your-client-id\", \"your-client-secret\", \"your-username\", \"your-password\", \"token-endpoint-url\");\n\n//the AuthenticationClient object will then contain the instance URL and access token to be used in each of the API calls\nForceClient client = new ForceClient(auth.AccessInfo.InstanceUrl, auth.ApiVersion, auth.AccessInfo.AccessToken);\n\n//Retrieve an object by Id\nSfAccount acct = await client.GetObjectById\u003cSfAccount\u003e(SfAccount.SObjectTypeName, \"001i000002C8QTI\");\n//Modify the record and update\nacct.Description = \"Updated Description\";\nawait client.UpdateRecord\u003cSfAccount\u003e(SfAccount.SObjectTypeName, acct.Id, acct);\n//Delete the record\nawait client.DeleteRecord(SfAccount.SObjectTypeName, acct.Id);\n\n//Get the results of a SOQL query\nList\u003cSfCase\u003e cases = await client.Query\u003cSfCase\u003e(\"SELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case\");\n```\n\n### Nested Query Results\n\nWhen you include related objects in a SOQL query:\n```\nSELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case\n```\n\nAnd get the results via the client, you can then access the related objects and fields included in the query in a fluent manner.\n```csharp\nList\u003cSfCase\u003e cases = await client.Query\u003cSfCase\u003e(\"SELECT Id,CaseNumber,Account.Name,Contact.Name FROM Case\");\nSfCase firstCase = cases[0];\nstring caseNumber = firstCase.CaseNumber;\nstring caseAccountName = firstCase.Account.Name;\nstring caseContactName = firstCase.Contact.Name;\n```\n\nNested 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.\n```\n// *NOT* fully supported\n\"SELECT Id,CaseNumber, (Select Contact.Name from Account) FROM Case\"\n```\n\n### Asynchronous Batch Processing\n\nQuery\u003cT\u003e method will retrieve the full result set before returning. By default, results are returned in batches of 2000.\nIn cases where you are working with large result sets, you may want to use QueryAsync\u003cT\u003e to retrieve the batches asynchronously for better performance.\n\n```csharp\n// First create the async enumerable. At this point, no query has been executed.\n// batchSize can be omitted to use the default (usually 2000), or given a custom value between 200 and 2000.\nIAsyncEnumerable\u003cSfContact\u003e contactsEnumerable = client.QueryAsync\u003cSfContact\u003e(\"SELECT Id, Name FROM Contact \", batchSize: 200);\n\n// Get the enumerator, in a using block for proper disposal\nawait using (IAsyncEnumerator\u003cSfContact\u003e contactsEnumerator = contactsEnumerable.GetAsyncEnumerator())\n{\n    // MoveNext() will execute the query and get the first batch of results.\n    // Once the inital result batch has been exhausted, the remaining batches, if any, will be retrieved.\n    while (await contactsEnumerator.MoveNextAsync())\n    {\n        SfContact contact = contactsEnumerator.Current;\n        // process your results\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyreilly%2FNetCoreForce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonyreilly%2FNetCoreForce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyreilly%2FNetCoreForce/lists"}