revamping domain

This commit is contained in:
2022-10-30 18:36:23 -05:00
parent b8ac227199
commit 689de35c3b
16 changed files with 161 additions and 105 deletions

View File

@@ -3,24 +3,25 @@ using System;
namespace Shogi.Api.Repositories.CouchModels
{
public abstract class CouchDocument
{
[JsonProperty("_id")] public string Id { get; set; }
[JsonProperty("_rev")] public string? RevisionId { get; set; }
public WhichDocumentType DocumentType { get; }
public DateTimeOffset CreatedDate { get; set; }
[Obsolete]
public abstract class CouchDocument
{
[JsonProperty("_id")] public string Id { get; set; }
[JsonProperty("_rev")] public string? RevisionId { get; set; }
public WhichDocumentType DocumentType { get; }
public DateTimeOffset CreatedDate { get; set; }
public CouchDocument(WhichDocumentType documentType)
: this(string.Empty, documentType, DateTimeOffset.UtcNow) { }
public CouchDocument(WhichDocumentType documentType)
: this(string.Empty, documentType, DateTimeOffset.UtcNow) { }
public CouchDocument(string id, WhichDocumentType documentType)
: this(id, documentType, DateTimeOffset.UtcNow) { }
public CouchDocument(string id, WhichDocumentType documentType)
: this(id, documentType, DateTimeOffset.UtcNow) { }
public CouchDocument(string id, WhichDocumentType documentType, DateTimeOffset createdDate)
{
Id = id;
DocumentType = documentType;
CreatedDate = createdDate;
}
}
public CouchDocument(string id, WhichDocumentType documentType, DateTimeOffset createdDate)
{
Id = id;
DocumentType = documentType;
CreatedDate = createdDate;
}
}
}