first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Claim = System.Security.Claims.Claim;
|
||||
|
||||
namespace OpenWarehouse.warehouse.api.Data;
|
||||
|
||||
public class ClaimBase
|
||||
{
|
||||
[Required]
|
||||
public string? ClaimType { get; set; }
|
||||
[Required]
|
||||
public string? ClaimValue { get; set; }
|
||||
public string? ClaimIssuer { get; set; }
|
||||
|
||||
|
||||
[NotMapped]
|
||||
public Claim Claim {
|
||||
get
|
||||
{
|
||||
return new Claim(ClaimType ?? throw new Exception("Null exemption")
|
||||
, ClaimValue ?? throw new Exception("Null exemption")
|
||||
, ClaimIssuer ?? "Local");
|
||||
}
|
||||
set
|
||||
{
|
||||
ClaimType = value.Type;
|
||||
ClaimValue = value.Value;
|
||||
ClaimIssuer = value.Issuer;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user