daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. What's the difference between these two StructureMap configs?
  2. ObjectFactory.Initialize(x =>
  3. {
  4.     x.For<IBusinessRelationsContext>().Use<BusinessRelationsContext>().Ctor<string>().Is(ConfigurationManager.ConnectionStrings["BusinessRelationsContext"].ConnectionString);
  5.     x.For<IBusinessRelationsContext>().Use(_ => new BusinessRelationsContext(ConfigurationManager.ConnectionStrings["BusinessRelationsContext"].ConnectionString));
  6. });
  7.    
  8. public BusinessRelationsContext();
  9. public BusinessRelationsContext(string connectionString);
  10. public BusinessRelationsContext(EntityConnection connection);
  11.    
  12. ObjectFactory.TryGetInstance<IBusinessRelationsContext>();
  13.    
  14. x.For<IBusinessRelationsContext>().Use(_ => new BusinessRelationsContext(ConfigurationManager.ConnectionStrings["BusinessRelationsContext"].ConnectionString));
  15.    
  16. x.SelectConstructor<IBusinessRelationsContext>(() => new BusinessRelationsContext(""));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top