File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
exercise.wwwapi/DTOs/Posts/GetPosts Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace exercise.wwwapi.DTOs.Posts.GetPosts
55 public class CommentDTO
66 {
77 public int Id { get ; set ; }
8+ public int ? UserId { get ; set ; }
89 public string ? firstName { get ; set ; }
910 public string ? lastName { get ; set ; }
1011 public string Body { get ; set ; } = string . Empty ;
@@ -19,6 +20,7 @@ public CommentDTO(Comment model)
1920 CreatedAt = model . CreatedAt ;
2021 if ( model . User != null )
2122 {
23+ UserId = model . UserId ;
2224 firstName = model . User . FirstName ;
2325 lastName = model . User . LastName ;
2426 }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ namespace exercise.wwwapi.DTOs.Posts.GetPosts
66 public class PostDTO
77 {
88 public int Id { get ; set ; }
9+ public int AuthorId { get ; set ; }
910 public string Firstname { get ; set ; }
1011 public string Lastname { get ; set ; }
1112 public string Body { get ; set ; } = string . Empty ;
@@ -19,6 +20,7 @@ public PostDTO() { }
1920 public PostDTO ( Post model )
2021 {
2122 Id = model . Id ;
23+ AuthorId = model . AuthorId ;
2224 Firstname = model . Author . FirstName ;
2325 Lastname = model . Author . LastName ;
2426 Body = model . Body ;
You can’t perform that action at this time.
0 commit comments