Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public interface IMappingRuleFactory
  2. {
  3. IMappingRule Create(string mappingRuleName, dynamic parameters);
  4. }
  5.  
  6. public interface IMappingRule
  7. {
  8. void Execute();
  9. }
  10.  
  11. public class MappingRuleFactory : IMappingRuleFactory
  12. {
  13. public IMappingRule Create(string mappingRuleName, dynamic parameters)
  14. {
  15. IMappingRule mappingRule = null;
  16.  
  17. switch (mappingRuleName)
  18. {
  19. case "fooBaz":
  20. mappingRule = new FooBaz(parameters);
  21. break;
  22. }
  23.  
  24. return mappingRule;
  25. }
  26. }
  27.  
  28. }],
  29. }
  30.  
  31. }],
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement