# How to define type-aliases?

  1. Open the respective .kdata file.

    For example to define a domain function, such as findLotteryWithName which returns a LotteryRow, first define the type-alias for LotteryRow.

  2. Define the type-alias using keyword type-alias as 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