[#23] Client: Refactoring to optimize memory usage
Signed-off-by: Pavel Gross <p.gross@yando.com>
This commit is contained in:
parent
1a02ac2ae7
commit
6562aa27a5
141 changed files with 1722 additions and 896 deletions
|
@ -1,7 +1,5 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FrostFS.SDK.ModelsV2;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2.Extensions;
|
||||
|
||||
|
@ -21,29 +19,29 @@ public static class ObjectExtensions
|
|||
|
||||
public static FrostFsObject AddAttribute(this FrostFsObject obj, string key, string value)
|
||||
{
|
||||
obj.AddAttribute(new ObjectAttribute(key, value));
|
||||
obj.AddAttribute(new FrostFsAttribute(key, value));
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static FrostFsObject AddAttribute(this FrostFsObject obj, ObjectAttribute attribute)
|
||||
public static FrostFsObject AddAttribute(this FrostFsObject obj, FrostFsAttribute attribute)
|
||||
{
|
||||
obj.Header.Attributes.Add(attribute);
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static FrostFsObject AddAttributes(this FrostFsObject obj, IEnumerable<ObjectAttribute> attributes)
|
||||
public static FrostFsObject AddAttributes(this FrostFsObject obj, IEnumerable<FrostFsAttribute> attributes)
|
||||
{
|
||||
obj.Header.Attributes.AddRange(attributes);
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static FrostFsObject SetSplit(this FrostFsObject obj, Split? split)
|
||||
public static FrostFsObject SetSplit(this FrostFsObject obj, FrostFsSplit? split)
|
||||
{
|
||||
obj.Header.Split = split;
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static LinkObject AddChildren(this LinkObject linkObject, IEnumerable<ObjectId> objectIds)
|
||||
public static FrostFsLinkObject AddChildren(this FrostFsLinkObject linkObject, IEnumerable<FrostFsObjectId> objectIds)
|
||||
{
|
||||
linkObject.Header.Split!.Children.AddRange(objectIds);
|
||||
return linkObject;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue