Skip to content

Commit

Permalink
Add Guid support for Lecturers and Tags, add ctor to Lecturer.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
scogliera committed Dec 9, 2023
1 parent 5961003 commit 9315b78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Models/Lecturer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ namespace TeacherDigitalAgency.Models;

public class Lecturer
{
// TODO: Find out how UUIDs get generated -> C# or Mongo solution
[JsonPropertyName("uuid")] public string Uuid { get; init; }
public Lecturer(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}

[JsonPropertyName("uuid")] public Guid Uuid { get; init; } = Guid.NewGuid();
[JsonPropertyName("title_before")] public string? TitleBefore { get; set; }
[JsonPropertyName("first_name")] public required string FirstName { get; set; }
[JsonPropertyName("middle_name")] public string? MiddleName { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Models/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace TeacherDigitalAgency.Models;

public class Tag
{
[JsonPropertyName("uuid")] public required string Uuid { get; init; }
[JsonPropertyName("uuid")] public Guid Uuid { get; init; } = Guid.NewGuid();
[JsonPropertyName("name")] public required string Name { get; set; }
}

0 comments on commit 9315b78

Please sign in to comment.