Skip to content

Commit

Permalink
Turn models into record
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Jun 17, 2023
1 parent ccd0345 commit ec74f9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ReportingApi/Models/CspReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ReportingApi.Models;

public class CspReport : IReportBody
public sealed record CspReport : IReportBody
{
[JsonPropertyName("blockedURL")]
public string BlockedUri { get; set; } = null!;
Expand Down
4 changes: 2 additions & 2 deletions src/ReportingApi/Models/ReportRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ReportingApi.Models;

[JsonConverter(typeof(ReportRequestConverter))]
public class ReportRequest
public record ReportRequest
{
[JsonPropertyName("age")]
public int Age { get; set; }
Expand All @@ -16,7 +16,7 @@ public class ReportRequest
public string UserAgent { get; set; } = null!;
}

public class ReportRequest<TBody> : ReportRequest
public sealed record ReportRequest<TBody> : ReportRequest
where TBody : class, IReportBody
{
[JsonPropertyName("body")]
Expand Down

0 comments on commit ec74f9b

Please sign in to comment.