diff options
author | crupest <crupest@outlook.com> | 2022-12-12 20:30:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | d8f12e14f3cebd759a8ee911cabb9585063606cb (patch) | |
tree | 5612df6f003faeb2b39c063c7fb3b09c7acb7e4a /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs | |
parent | ce8adb2c5ff7d71592a4173eb06391b01cc45f22 (diff) | |
download | crupest-d8f12e14f3cebd759a8ee911cabb9585063606cb.tar.gz crupest-d8f12e14f3cebd759a8ee911cabb9585063606cb.tar.bz2 crupest-d8f12e14f3cebd759a8ee911cabb9585063606cb.zip |
Develop secret api. v31
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs index 841ba40..37d77ca 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/ParamMap.cs @@ -6,6 +6,9 @@ namespace CrupestApi.Commons.Crud; /// <summary> /// <see cref="ColumnName"/> is an optional column name related to the param. You may use it to do some column related things. Like use a more accurate conversion. /// </summary> +/// <remarks> +/// If value is DbNullValue, it will be treated as null. +/// </remarks> public record ParamInfo(string Name, object? Value, string? ColumnName = null); public class ParamList : List<ParamInfo> @@ -41,6 +44,11 @@ public class ParamList : List<ParamInfo> return this.SingleOrDefault(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase)) is not null; } + public T? Get<T>(string key) + { + return (T?)this.SingleOrDefault(p => p.Name.Equals(key, StringComparison.OrdinalIgnoreCase))?.Value; + } + public object? this[string key] { get |