January 2020
Intermediate to advanced
532 pages
13h 31m
English
Sometimes, we need to support multiple types in a field. This can be done using a Union type, which is defined as a type that can accept any specified types. To define a Union type, we can just enclose the types within curly braces after the Union keyword. For example, the Union type of Int64 and BigInt can be defined as follows:
Union{Int64,BigInt}
These Union types are quite useful when you need to incorporate data types that come from different data type hierarchies. Let's extend our personal asset example further. For instance, say that we need to incorporate some exotic items into our data model, which may include things such as art pieces, antiques, paintings, and so on. These new concepts ...
Read now
Unlock full access