Class ProxyDemo.EmailServiceAdapter
- Namespace
- PatternKit.Examples.ProxyDemo
- Assembly
- PatternKit.Examples.dll
Adapter that wraps a proxy to implement the ProxyDemo.IEmailService interface.
public sealed class ProxyDemo.EmailServiceAdapter : ProxyDemo.IEmailService
- Inheritance
-
ProxyDemo.EmailServiceAdapter
- Implements
- Inherited Members
- Extension Methods
Remarks
This demonstrates how proxies can be adapted to standard interfaces, enabling dependency injection and testability.
Constructors
EmailServiceAdapter(Proxy<(string to, string subject, string body), bool>)
Initializes a new instance of the ProxyDemo.EmailServiceAdapter class.
public EmailServiceAdapter(Proxy<(string to, string subject, string body), bool> proxy)
Parameters
Methods
SendEmail(string, string, string)
Sends an email message.
public bool SendEmail(string to, string subject, string body)
Parameters
tostringThe recipient email address.
subjectstringThe email subject.
bodystringThe email body content.