begin: PHI Column Encryption

This commit is contained in:
voltsrage
2026-06-22 21:18:36 +08:00
parent 518cc5b99a
commit 46db694820
21 changed files with 3177 additions and 6 deletions
@@ -0,0 +1,31 @@
public enum PhiAccessType
{
View,
List,
Search,
Create,
Update
}
public static class PhiAccessTypeExtensions
{
public static string ToDbString(this PhiAccessType t) => t switch
{
PhiAccessType.View => "VIEW",
PhiAccessType.List => "LIST",
PhiAccessType.Search => "SEARCH",
PhiAccessType.Create => "CREATE",
PhiAccessType.Update => "UPDATE",
_ => throw new ArgumentOutOfRangeException(nameof(t))
};
public static PhiAccessType FromDbString(string v) => v switch
{
"VIEW" => PhiAccessType.View,
"LIST" => PhiAccessType.List,
"SEARCH" => PhiAccessType.Search,
"CREATE" => PhiAccessType.Create,
"UPDATE" => PhiAccessType.Update,
_ => throw new ArgumentOutOfRangeException(nameof(v))
};
}