Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- FactoryCollection class
- */
- public class FactoryCollection<T> where T : BusinessData
- {
- public void AddFactory<T>() where T : BusinessData
- {
- string name = typeof(T).Name;
- Factory<T> factory = new Factory<T>(_connection, name);
- Factories.Add(name, factory);
- }
- }
- /*
- The call
- */
- Factories = new FactoryCollection<BusinessData>(DatabaseConnection);
- Factories.AddFactory<Customer>();
- /*
- The error
- */
- 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