diff --git a/src/ForceToolkitForNET/ForceClient.cs b/src/ForceToolkitForNET/ForceClient.cs index b30135cf..fee30e12 100644 --- a/src/ForceToolkitForNET/ForceClient.cs +++ b/src/ForceToolkitForNET/ForceClient.cs @@ -155,6 +155,15 @@ public Task UpdateAsync(string objectName, string recordId, obj return _jsonHttpClient.HttpPatchAsync(record, string.Format("sobjects/{0}/{1}", objectName, recordId)); } + public Task UpdateAsync(string objectName, string recordId, object record, bool ignoreNull) + { + if (string.IsNullOrEmpty(objectName)) throw new ArgumentNullException("objectName"); + if (string.IsNullOrEmpty(recordId)) throw new ArgumentNullException("recordId"); + if (record == null) throw new ArgumentNullException("record"); + + return _jsonHttpClient.HttpPatchAsync(record, string.Format("sobjects/{0}/{1}", objectName, recordId), ignoreNull); + } + public Task UpsertExternalAsync(string objectName, string externalFieldName, string externalId, object record) { if (string.IsNullOrEmpty(objectName)) throw new ArgumentNullException("objectName"); diff --git a/src/ForceToolkitForNET/IForceClient.cs b/src/ForceToolkitForNET/IForceClient.cs index aa53de42..bd277e5e 100644 --- a/src/ForceToolkitForNET/IForceClient.cs +++ b/src/ForceToolkitForNET/IForceClient.cs @@ -21,6 +21,7 @@ public interface IForceClient : IDisposable Task CreateAsync(string objectName, object record); Task CreateAsync(string objectName, CreateRequest request); Task UpdateAsync(string objectName, string recordId, object record); + Task UpdateAsync(string objectName, string recordId, object record, bool ignoreNull); Task UpsertExternalAsync(string objectName, string externalFieldName, string externalId, object record); Task UpsertExternalAsync(string objectName, string externalFieldName, string externalId, object record, bool ignoreNull); Task DeleteAsync(string objectName, string recordId);