Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active Oct 9, 2021
Embed
What would you like to do?
NServiceBus Cosmos Sample - Domain
public class Post
{
public Post(string postId,
string title,
string description,
string author)
{
Id = postId;
PostId = postId;
Title = title;
Description = description;
Author = author;
LastUpdatedDate = DateTime.UtcNow;
CreatedDate = DateTime.UtcNow;
}
[JsonProperty("id")] public string Id { get; set; }
public string PostId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Author { get; set; }
public DateTime LastUpdatedDate { get; set; }
public DateTime CreatedDate { get; set; }
}
public class Comment
{
public Comment(string postId,
string commentId,
string content,
string commentedBy)
{
Id = commentId;
PostId = postId;
Content = content;
CommentedBy = commentedBy;
CreatedDate = DateTime.UtcNow;
}
[JsonProperty("id")] public string Id { get; set; }
public string PostId { get; set; }
public string Content { get; set; }
public string CommentedBy { get; set; }
public DateTime CreatedDate { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment