✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
public class DbLazyProxy : IDb
{
private IDb? _real; private readonly string _cs;
public DbLazyProxy(string cs)=>_cs=cs;
private IDb Real=>_real ??= new SqlDb(_cs);
public int Query(string q)=>Real.Query(q);
}
Головна вигода DbLazyProxy: