DynamoVisualProgramming.DynamoServices by Autodesk

<PackageReference Include="DynamoVisualProgramming.DynamoServices" Version="1.2.2-beta93" />

 KeepReferenceAttribute

This attribute indicates the parameter will be referenced by the return object, hence its DS wrap object shouldn't be disposed even it is out of scope. The life-cycle of parameter will have the same life-cycle as the return object. Note the type of return object should be reference type, either a pointer or an array.
using System; namespace Autodesk.DesignScript.Runtime { [AttributeUsage(AttributeTargets.Parameter)] public class KeepReferenceAttribute : Attribute { } }