https://kotlinlang.org logo
#ktor
Title
# ktor
h

hyukchan

04/11/2019, 9:52 AM
Hi, I'm having an issue understanding and using suspend function with dependency injection ...
Copy code
class SdWsService(fileUtils: FileUtils) {
    suspend fun getXmlFile(environment: String?, filename: String): String = dbQuery(environment) {
Inside getXmlFile, I do not have access to my fileUtils ...
d

diesieben07

04/11/2019, 9:57 AM
fileUtils
is just a constructor parameter. If you want it to be a property of your class, add the
val
keyword...
h

hyukchan

04/11/2019, 10:03 AM
Oh that was rather stupid by me ^^' Thanks for your help