[#13] Client: Use code analyzers
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
d7dbbf8da8
commit
d1271df207
102 changed files with 2168 additions and 733 deletions
|
@ -17,6 +17,11 @@ public static class OwnerIdMapper
|
|||
|
||||
public static OwnerID ToMessage(this FrostFsOwner model)
|
||||
{
|
||||
if (model is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
|
||||
if (!Cache.Owners.TryGetValue(model, out OwnerID? message))
|
||||
{
|
||||
message = new OwnerID
|
||||
|
@ -32,10 +37,15 @@ public static class OwnerIdMapper
|
|||
|
||||
public static FrostFsOwner ToModel(this OwnerID message)
|
||||
{
|
||||
if (message is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(message));
|
||||
}
|
||||
|
||||
if (!Cache.Owners.TryGetValue(message, out FrostFsOwner? model))
|
||||
{
|
||||
model = new FrostFsOwner(Base58.Encode(message.Value.ToByteArray()));
|
||||
|
||||
|
||||
Cache.Owners.Set(message, model, _oneHourExpiration);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue