Skip to content

Commit bc14303

Browse files
authored
Merge pull request #90 from boolean-uk/makeJakubHappy
addedIds
2 parents 6af1cad + abd3c62 commit bc14303

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

exercise.wwwapi/DTOs/Posts/GetPosts/CommentDTO.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

exercise.wwwapi/DTOs/Posts/GetPosts/PostDTO.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)