48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
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; }
|
|
|
|
|
|
[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; }
|
|
}
|
|
}
|
|
}
|