initial
This commit is contained in:
54
Entities/SalesforceEntity.cs
Normal file
54
Entities/SalesforceEntity.cs
Normal file
@ -0,0 +1,54 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user