Skip to content

Commit d91cc03

Browse files
committed
better comments and answers
1 parent fddb3a3 commit d91cc03

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

β€ŽC#/Answers/a008.csβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public bool CreateUser(UserDTO user)
1919
}
2020
}
2121

22+
// Make use of Attributes when it comes to model classes
2223
public class UserDTO{
2324
[Required]
2425
[StringLength(24, MinimumLength = 3, ErrorMessage = "Username must be between 4 and 24 characters in length.")]

β€ŽC#/Answers/a009.csβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class BrokenController : Controller
66
[HttpGet]
77
public IHttpActionResult GetBrokenRecord(int id)
88
{
9-
var record = records.FirstOrDefault((p) => p.Id == id && p.OwnerId == User.Id); // Here we add a condition so that the authorized user only gets to see its owned records.
9+
var record = records.FirstOrDefault((p) => p.Id == id && p.OwnerId == User.Id); // Here we add a condition so that the authorized user only gets to see its own records.
1010
if (record == null)
1111
{
1212
return NotFound();

0 commit comments

Comments
 (0)