C#の話はおいといて、Scalaの標準ライブラリにLoanパターンを実装したの取り込んでくれないかねえ
要はこういうの

def using[A <: { def close(): Unit }, B](resource: A)(body: A => B): B = try {
 body(resource)
} finally {
 resource.close()
}