Advertisement
Guest User

Untitled

a guest
May 4th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. /*
  2. FactoryCollection class
  3. */
  4.  
  5. public class FactoryCollection<T> where T : BusinessData
  6. {
  7. public void AddFactory<T>() where T : BusinessData
  8. {
  9. string name = typeof(T).Name;
  10.  
  11. Factory<T> factory = new Factory<T>(_connection, name);
  12. Factories.Add(name, factory);
  13. }
  14. }
  15.  
  16. /*
  17. The call
  18. */
  19.  
  20. Factories = new FactoryCollection<BusinessData>(DatabaseConnection);
  21. Factories.AddFactory<Customer>();
  22.  
  23. /*
  24. The error
  25. */
  26.  
  27. The best overloaded method match for 'System.Collections.Generic.Dictionary<string,Factory<T>>.Add(string, Factory<T>)' has some invalid arguments
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement