Created
July 11, 2018 18:47
-
-
Save changhuixu/59f2b729fe124015b191a7eeb0e353f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Author.cs | |
public class Author | |
{ | |
public int Id { get; protected set; } | |
public string FirstName { get; protected set; } | |
public string LastName { get; protected set; } | |
private readonly List<Blog> _blogs = new List<Blog>(); | |
public IReadOnlyCollection<Blog> Blogs => _blogs; | |
} | |
// Blog.cs | |
public class Blog | |
{ | |
public int Id { get; protected set; } | |
public string Title { get; protected set; } | |
public string Content { get; protected set; } | |
public int AuthorId { get; protected set; } | |
public Author Author { get; protected set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment