Skip to content

Commit da0caa1

Browse files
committed
Modified claim entity.
1 parent e720612 commit da0caa1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ClaimsSolution.Common/Models/ClaimEntity.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Azure;
1+
using Azure;
22
using Azure.Data.Tables;
33

44
namespace ClaimsSolution.Common.Models
@@ -11,14 +11,22 @@ public ClaimEntity()
1111

1212
public ClaimEntity(Guid userId, Guid claimId)
1313
{
14-
PartitionKey = userId.ToString();
15-
RowKey = claimId.ToString();
1614
UserId = userId;
1715
ClaimId = claimId;
1816
}
1917

20-
public string PartitionKey { get; set; } = string.Empty;
21-
public string RowKey { get; set; } = string.Empty;
18+
public string PartitionKey
19+
{
20+
get => UserId.ToString();
21+
set => UserId = string.IsNullOrEmpty(value) ? Guid.Empty : Guid.Parse(value);
22+
}
23+
24+
public string RowKey
25+
{
26+
get => ClaimId.ToString();
27+
set => ClaimId = string.IsNullOrEmpty(value) ? Guid.Empty : Guid.Parse(value);
28+
}
29+
2230
public DateTimeOffset? Timestamp { get; set; }
2331
public ETag ETag { get; set; }
2432

0 commit comments

Comments
 (0)