Link to home
Start Free TrialLog in
Avatar of mentor360
mentor360Flag for Colombia

asked on

Broker Class C Sharp with two sources.

I have my data distributed between a local database exposed by a class with all the logic and a WCF Service.
Some methods (selects) should be called to the local database  due performance, but the more complex ones should be called to the WCF proxy.
Is there a pattern implemented on C# that doesn't involve rewriting every method like a facade to decide wheather to go WCF or Local DB?

Example

My WCF Proxy has the method

IEnumerable<LanguageDTO> getLanguages();

Open in new window


And I have a class conected to the local database that also has the method

IEnumerable<LanguageDTO> getLanguages();

Open in new window


I am building a class called Broker that should expose also the method getLanguages() to the GUI and should decide which getLanguages to call (WCF or Database)

Is there a way of building that class without creating every method again?

Thanks
Avatar of mentor360
mentor360
Flag of Colombia image

ASKER

Reflection would be my last option.
ASKER CERTIFIED SOLUTION
Avatar of mentor360
mentor360
Flag of Colombia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial