mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-19 14:35:42 +00:00
[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user