# How to use the domain-logic-ref in command code?

Use the CommandSetCode's domainLogicRef property.

 



 



class LotteryCommandSetCode(domainLogicRef:DomainLogicRef) extends LotteryCommandSetCommands {
	 override def addParticipant = AddParticipantCommand {
    import AddParticipantCommand._
    input: Input =>
      val canAdd = domainLogicRef.lottery.canAddMoreParticipants(input.lotteryName)
	}
}