55 lines
1.9 KiB
C#
55 lines
1.9 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Text;
|
|||
|
|
|||
|
namespace Salesforce.NET.Entities
|
|||
|
{
|
|||
|
public abstract class SalesforceEntity
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Instructs the serializer whether to serialize read-only entity properties
|
|||
|
/// </summary>
|
|||
|
[JsonIgnore]
|
|||
|
public bool SerializeReadOnlyProperties { get; set; } = true;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// The unique ID of the record
|
|||
|
/// </summary>
|
|||
|
[JsonProperty("id")]
|
|||
|
public string RecordId { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Used to correlate a record insert to a batch
|
|||
|
/// </summary>
|
|||
|
[QueryIgnore]
|
|||
|
public int TransactionId { get; set; }
|
|||
|
|
|||
|
[QueryIgnore]
|
|||
|
public RecordAttributes Attributes { get; set; }
|
|||
|
|
|||
|
public bool IsDeleted { get; set; }
|
|||
|
public string OwnerId { get; set; }
|
|||
|
public string CreatedById { get; set; }
|
|||
|
public DateTime CreatedDate { get; set; }
|
|||
|
public string LastModifiedById { get; set; }
|
|||
|
public DateTime LastModifiedDate { get; set; }
|
|||
|
|
|||
|
public bool ShouldSerializeTransactionId() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeAttributes() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeId() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeIsDeleted() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeOwnerId() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeCreatedById() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeCreatedDate() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeLastModifiedById() => SerializeReadOnlyProperties;
|
|||
|
public bool ShouldSerializeLastModifiedDate() => SerializeReadOnlyProperties;
|
|||
|
|
|||
|
public class RecordAttributes
|
|||
|
{
|
|||
|
public string Type { get; set; }
|
|||
|
public string Url { get; set; }
|
|||
|
}
|
|||
|
}
|
|||
|
}
|