SFDC.SalesforceApi 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SFDC.SalesforceApi --version 1.0.0
NuGet\Install-Package SFDC.SalesforceApi -Version 1.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="SFDC.SalesforceApi" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SFDC.SalesforceApi --version 1.0.0
#r "nuget: SFDC.SalesforceApi, 1.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.
// Install SFDC.SalesforceApi as a Cake Addin
#addin nuget:?package=SFDC.SalesforceApi&version=1.0.0

// Install SFDC.SalesforceApi as a Cake Tool
#tool nuget:?package=SFDC.SalesforceApi&version=1.0.0

Code to Create Matadata Custom Fields:

@using SFDC

    SalesForceApi api = new SalesForceApi();
    var loginInfo = api.Login("abc@m.com", "********");

    ElementModel model = new ElementModel()
    {
        FullName = "Account.CustomFieldTest3__c",
        Type = FieldType.Url,
        Label = "CustomTest",
    };

    MetadataApi meta = new MetadataApi(loginInfo.sessionId,loginInfo.metadataServerUrl);
    UpsertResult[] result = meta.CreateCustomField(model);

Custom Objects :

    CustomObject co = new CustomObject();
    co.fullName = model.FullName.Replace(' ', '_') + "__c";
    co.deploymentStatus = DeploymentStatus.Deployed;
    co.deploymentStatusSpecified = true;
    co.description = model.Description;
    co.enableActivities = true;
    co.label = model.Label;
    co.pluralLabel = model.Label + "s";
    co.sharingModel = SharingModel.ReadWrite;
    co.sharingModelSpecified = true;

    co.fields = new CustomField[]{};
    co.nameField = new CustomField();
    co.nameField.label = model.Label;
    co.nameField.type = FieldType.Text;
    co.nameField.typeSpecified = true;
    UpsertResult[] result2 = meta.UpsertCustomObject(co);

Create/Update an actual Opportunity/Contact

SalesForceApi api = new SalesForceApi(); var loginInfo = api.Login("abc@m.com", "********");

---OR SalesForceApi api2 = new SalesForceApi("endPointUrl","sessionId");

    CreateSObject opportunity = new CreateSObject()
    {
        Type = "Opportunity",
        Fields = new List<ElementField>()
        {
            new ElementField()
            {
                Key = "Name",
                Value = "My New Opportunity Name"
            },
            new ElementField()
            {
                Key = "Amount",
                Value = "999"
            },
        }
    };

    SFDC.soapApi.SaveResult[] saveResults = api2.CreateElement(opportunity);


    UpdateSObject contact = new UpdateSObject()
    {
        Id = "0031W0000213yCzQAI",
        Type = "Contact",
        Fields = new List<ElementField>()
        {
            new ElementField()
            {
                Key = "FirstName",
                Value = "Otto"
            },
            new ElementField()
            {
                Key = "LastName",
                Value = "Jespersen"
            },
        }
    };

    SFDC.soapApi.SaveResult[] saveResults = api2.UpdateElement(contact);
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
1.0.0.3 1,560 1/26/2018
1.0.0.2 1,073 1/26/2018
1.0.0.1 1,024 1/25/2018
1.0.0 975 1/25/2018

Summary of changes made in this release of the package.