Created
July 10, 2021 19:36
-
-
Save Chriz76/78c045f6f71bd68b69adef4230ff4cda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using System; | |
using System.ComponentModel.DataAnnotations; | |
namespace PostService.Entities | |
{ | |
[Index(nameof(PostId), nameof(CategoryId))] | |
public class Post | |
{ | |
public int PostId { get; set; } | |
public string Title { get; set; } | |
public string Content { get; set; } | |
public Int64 TimeStamp { get; set; } | |
public int UserId { get; set; } | |
public User User { get; set; } | |
[Required] | |
public string CategoryId { get; set; } | |
public Category Category { get; set; } | |
} | |
public class Category | |
{ | |
public string CategoryId { get; set; } | |
public long PostCount { get; set; } | |
} | |
public class User | |
{ | |
public int ID { get; set; } | |
public string Name { get; set; } | |
public int Version { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment