The thing is, EF creates EntitiesContextFactory for us, so the only way for us to get a parameter in is via a static property. The GalleryGateway takes the connection string it's given and injects it here to ensure we create the EntitiesContext with the correct ConnectionString even though web.config isn't there.