# C# node return list

**URL:** <https://forum.dynamobim.com/t/c-node-return-list/3169>\
**Category:** Packages\
**Created:** [February 13, 2016, 6:16pm UTC](https://forum.dynamobim.com/t/c-node-return-list/3169 "2016-02-13T18:16:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicklas\_Verdier\_Ost1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nicklas_verdier_ost1/32/9401_2.png) [@Nicklas\_Verdier\_Ost1](https://forum.dynamobim.com/u/Nicklas_Verdier_Ost1)\
**Post date:** [February 13, 2016, 6:16pm UTC](https://forum.dynamobim.com/t/c-node-return-list/3169/1 "2016-02-13T18:16:00Z")

</div>

This should be easy, but still I can’t get my head around this. How can I return a simple list?

```
publicoverrideIEnumerable<AssociativeNode> BuildOutputAst(List<AssociativeNode> inputAstNodes)
{if(Items.Count == 0 ||
        Items[0].Name =="BS ApiKey error"||
        SelectedIndex == -1)
    {returnnew[] {AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0),AstFactory.BuildNullNode()) };
    }// get the selected items name//var stringNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item);varnode =AstFactory.BuildExprList(BSDoc);// assign the selected name to an actual enumeration valuevarassign =AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), node);// return the enumeration valuereturnnewList<AssociativeNode> { assign };
}
```

---

<div class="post-metadata">

**Author:** ![Yu\_Ke](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yu\_Ke](https://forum.dynamobim.com/u/Yu_Ke)\
**Post date:** [February 15, 2016, 1:11am UTC](https://forum.dynamobim.com/t/c-node-return-list/3169/2 "2016-02-15T01:11:00Z")

</div>

Hi Nicklas, this piece of code looks good. It returns a list (suppose BSDoc here is a list of string) . Doesn’t work?

---

<div class="post-metadata">

**Author:** ![Nicklas\_Verdier\_Ost1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nicklas_verdier_ost1/32/9401_2.png) [@Nicklas\_Verdier\_Ost1](https://forum.dynamobim.com/u/Nicklas_Verdier_Ost1)\
**Post date:** [February 15, 2016, 4:18am UTC](https://forum.dynamobim.com/t/c-node-return-list/3169/3 "2016-02-15T04:18:26Z")

</div>

No my code do not work. I get a list with ”null” for every item in the list. When I debug my code the list (BSDoc) looks fine…

---

<div class="post-metadata">

**Author:** ![vyar\_throt](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vyar\_throt](https://forum.dynamobim.com/u/vyar_throt)\
**Post date:** [April 16, 2016, 12:56am UTC](https://forum.dynamobim.com/t/c-node-return-list/3169/4 "2016-04-16T00:56:09Z")

</div>

A good tutorial on…[C# List](http://csharp.net-informations.com/collection/list.htm)

Throt

---

<div class="post-metadata">

**Author:** ![Nicklas\_Verdier\_Ost1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nicklas_verdier_ost1/32/9401_2.png) [@Nicklas\_Verdier\_Ost1](https://forum.dynamobim.com/u/Nicklas_Verdier_Ost1)\
**Post date:** [April 17, 2016, 6:59am UTC](https://forum.dynamobim.com/t/c-node-return-list/3169/5 "2016-04-17T06:59:24Z")

</div>

thank you. I got a reply that helped me going on the dynamo github page.
