Skip to content

Commit 6794d76

Browse files
CODE RUB: Ignore Books on Reader write requests and hide from Swagger
1 parent 5424796 commit 6794d76

File tree

1 file changed

+5
-1
lines changed
  • LibraryManagement.Api/Models/Foundations/Readers

1 file changed

+5
-1
lines changed

LibraryManagement.Api/Models/Foundations/Readers/Reader.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Free To Use To Build Reliable Library Management Solutions
44
//-----------------------------------------------------------
55

6+
using System.Text.Json.Serialization;
67
using LibraryManagement.Api.Models.Foundations.Books;
78

89
namespace LibraryManagement.Api.Models.Foundations.Readers
@@ -13,6 +14,9 @@ public class Reader
1314
public string FirstName { get; set; }
1415
public string LastName { get; set; }
1516
public DateTimeOffset DateOfBirth { get; set; }
16-
public List<Book> Books { get; set; }
17+
18+
[JsonIgnore]
19+
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
20+
public List<Book> Books { get; set; } = new();
1721
}
1822
}

0 commit comments

Comments
 (0)