This repository has been archived on 2024-03-05. You can view files and clone it, but cannot push or open issues or pull requests.
Salesforce.NET/Entities/SalesforceEntity.cs

55 lines
1.9 KiB
C#
Raw Normal View History

2021-04-20 22:10:07 +00:00
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; }
}
}
}