[C#] Add Union Constructor Utility for ObjectAPI. (#6105)

* [C#] add union constructor utility.

* add union utility test.

* std::tolower -> CharToLower

* use std::transform instead

* rebase to master. and regenerate test code
This commit is contained in:
mugisoba
2021-07-27 02:01:41 +09:00
committed by GitHub
parent ac23482022
commit e77926f0ed
7 changed files with 53 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ public class UnionInNestedNSUnion {
public T As<T>() where T : class { return this.Value as T; }
public NamespaceA.NamespaceB.TableInNestedNST AsTableInNestedNS() { return this.As<NamespaceA.NamespaceB.TableInNestedNST>(); }
public static UnionInNestedNSUnion FromTableInNestedNS(NamespaceA.NamespaceB.TableInNestedNST _tableinnestedns) { return new UnionInNestedNSUnion{ Type = UnionInNestedNS.TableInNestedNS, Value = _tableinnestedns }; }
public static int Pack(FlatBuffers.FlatBufferBuilder builder, UnionInNestedNSUnion _o) {
switch (_o.Type) {