Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active October 9, 2021 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/e5012529a0912c2ee36debdc033db9bf to your computer and use it in GitHub Desktop.
Save ankitvijay/e5012529a0912c2ee36debdc033db9bf to your computer and use it in GitHub Desktop.
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