mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Adapt MyBeanRegistrar Kotlin code sample
This commit adapts the MyBeanRegistrar Kotlin code sample to use a lambda supplier instead of a callable reference since this capability has been removed. See gh-35549 Closes gh-35694
This commit is contained in:
+3
-1
@@ -33,7 +33,9 @@ class MyBeanRegistrar : BeanRegistrarDsl({
|
||||
registerBean { Baz("Hello World!") }
|
||||
}
|
||||
registerBean<MyRepository>()
|
||||
registerBean(::myRouter)
|
||||
registerBean {
|
||||
myRouter(bean<MyRepository>()) // Also possible with just myRouter(bean())
|
||||
}
|
||||
})
|
||||
|
||||
fun myRouter(myRepository: MyRepository) = router {
|
||||
|
||||
Reference in New Issue
Block a user