# How to define type-aliases?
PREREQUISITE
Open the respective .kdata file.
For example to define a domain function, such as
findLotteryWithNamewhich returns a LotteryRow, first define the type-alias for LotteryRow.Define the type-alias using keyword
type-aliasas follows:type-alias TypeLotteryRow as "com.metastay.lotterymongo.LotteryRow"
# Sample Usage:
- Open the .kdomain file & define the function with return type as
LotteryData::LotteryRow
domain-logic Lottery{
...
function findLotteryWithName(lotteryName:String):LotteryData::TypeLotteryRow
}
Note: Ensure the LotteryDomain module has the dependency on LotteryData defined in .ksmile