NetCoreForce.Models 5.0.0

dotnet add package NetCoreForce.Models --version 5.0.0
                    
NuGet\Install-Package NetCoreForce.Models -Version 5.0.0
                    
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="NetCoreForce.Models" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetCoreForce.Models" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetCoreForce.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetCoreForce.Models --version 5.0.0
                    
#r "nuget: NetCoreForce.Models, 5.0.0"
                    
#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.
#addin nuget:?package=NetCoreForce.Models&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetCoreForce.Models&version=5.0.0
                    
Install as a Cake Tool

This is a set of model objects generated from a generic Salesforce Org, wihout any custom objects or fields.

Although using these models is optional, having strongly typed model objects is preferable in most cases. In addition to these predefined models, you can use the ModelGenerator tool to generate these classes against your own Org's data, including custom objects and custom fields.

If you just need to add a few custom fields, you can just inherit the class and add the properties as needed:

public class MyCustomAccount : SfAccount
{
    public string MyCustomField__c { get; set; }
    public string MyOtherField__c { get; set; }
}

The pre-generated classes are all prefixed with "Sf", e.g. SfAccount, SfContact. This was done to avoid a few object naming conflicts with reserved names such as Namespace and Domain, as well as some other objects that could cause class confusion such as Case and Task. This has the added bonus of making the model objects very easy to filter in Intellisense by typing "Sf" to get the list in your editor. The ModelGenerator can regenerate these with the plain object names, or another combination of prefixes and suffixes, if preferred.

Each object field is annotated with some basic Salesforce metadata, from the Label, Name, Type, and Custom flags.

///<summary>
/// Account ID
/// <para>Name: Id</para>
/// <para>SF Type: id</para>
/// <para>Custom: False</para>
///</summary>
[JsonProperty(PropertyName = "id")]
[Updateable(false), Createable(false)]
public string Id { get; set; }

They are also decorated with the Updatedable and Creatable attributes. These attributes control serialization behavior when creating and updating object records in Salesforce. The properties will be selectively serialized as appropriate for API action being called.
For instance, the Id field can never be supplied when creating or updating an object, as it is assigned by the system. While it will be deserialized when retrieving data, on creation and update it will be omitted from the request.

Properties that can be used on both create and updates can omit the attributes entirely and they will default to true:

[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

This is the same as:

[JsonProperty(PropertyName = "name")]
[Updateable(true), Createable(true)]
public string Name { get; set; }

Object relationships are included in the models.

///<summary>
/// ReferenceTo: Account
/// <para>RelationshipName: Parent</para>
///</summary>
[JsonProperty(PropertyName = "parent")]
[Updateable(false), Createable(false)]
public SfAccount Parent { get; set; }

This is primarily to support query results, where you might query Parent.Name to get a parent account object. That related object and field will be deserialized into that relationship property.

Typically non-nullable types (e.g. int, decimal) are in the models as nullable properties (e.g. int?, decimal?). Most SF fields are flagged as "nillable" and may return null in results. If they are not made nullable, a null field can deserialize to the default value, e.g. int = 0, instead of the null value. The JSON serializer is set to not serialize null values.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  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
5.0.0 657 6/22/2025
5.0.0-Beta 99 2/24/2025
4.1.0 170,425 5/24/2024
4.1.0-Beta 981 3/29/2024
4.0.0 105,104 6/6/2023
4.0.0-beta 513 1/24/2023
3.1.0 149,041 1/13/2022
3.0.1 45,628 5/7/2021
3.0.0 4,190 2/11/2021
3.0.0-Beta2 321 1/28/2021
2.7.0 892 1/4/2021
2.6.0 46,338 12/17/2019
2.5.0 23,112 11/25/2018
2.4.0 3,400 10/9/2018
2.3.0 979 9/18/2018
2.2.0 3,175 4/17/2018
2.1.0 1,149 3/9/2018
2.0.0 1,299 3/5/2018
2.0.0-rc3 1,061 2/28/2018
2.0.0-rc2 1,158 2/24/2018
2.0.0-rc1 1,096 2/23/2018
1.2.3 1,641 12/11/2017
1.2.2 1,186 10/27/2017
1.2.1 1,110 10/27/2017
1.2.0 1,114 10/25/2017
1.1.0 1,109 10/11/2017
1.0.0 1,210 8/30/2017
0.5.1-Beta 965 7/14/2017
0.5.0-Beta 906 7/11/2017
0.4.0-Beta 996 6/16/2017
0.3.0-Beta 947 6/5/2017
0.2.0-Beta 1,165 5/15/2017
0.1.0-Beta1 1,143 5/3/2017

Release notes and documentation can be found on the project site: https://github.com/anthonyreilly/NetCoreForce