public ProductEntity GetProductRequest() { // A virtual proxy creates the object only on its first method call i.e On demand if (realSubject == null) { realSubject = new ProductRealSubject(); } return(realSubject.GetProductRequest()); }
public string Authenticate(string _password) { if (_password != password) { validationMessage = "Authentication Failed"; } else { realSubject = new ProductRealSubject(); validationMessage = "Authenticated, Kindly Continue Shopping"; } return(validationMessage); }