Skip to content

Commit 0b56e98

Browse files
authored
Merge pull request #85 from boolean-uk/idInDTOs
added id in dtos
2 parents 65d0d05 + f203fc9 commit 0b56e98

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
@@ -4,6 +4,7 @@ namespace exercise.wwwapi.DTOs.Posts.GetPosts
44
{
55
public class CommentDTO
66
{
7+
public int Id { get; set; }
78
public string? firstName { get; set; }
89
public string? lastName { get; set; }
910
public string Body { get; set; } = string.Empty;
@@ -13,6 +14,7 @@ public class CommentDTO
1314
public CommentDTO() { }
1415
public CommentDTO(Comment model)
1516
{
17+
Id = model.Id;
1618
Body = model.Body;
1719
CreatedAt = model.CreatedAt;
1820
if (model.User != null)

exercise.wwwapi/DTOs/Posts/GetPosts/PostDTO.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
{
66
public class PostDTO
77
{
8+
public int Id { get; set; }
89
public string Firstname { get; set; }
910
public string Lastname { get; set; }
1011
public string Body { get; set; } = string.Empty;
@@ -17,6 +18,7 @@ public class PostDTO
1718
public PostDTO() { }
1819
public PostDTO(Post model)
1920
{
21+
Id = model.Id;
2022
Firstname = model.Author.FirstName;
2123
Lastname = model.Author.LastName;
2224
Body = model.Body;

0 commit comments

Comments
 (0)