Lesson 34. Using type providers in the real world
This is the final lesson on type providers. So far, you’ve looked at various providers in the data space. You understand how and where to use them, what their strengths are, and when and where you might not use them. In this lesson, you’ll wrap up by working specifically with type providers in a real-world development process. You’ll learn about
- Working with configuration files
- Manually redirecting type providers
- Using type providers in a continuous integration (CI) environment
You’ve already looked at how to point to live data sources in a type provider, by redirecting from a static data source to a remote one at runtime. Sometimes this works quickly and easily—as you saw with public sources such as the public NuGet feed—but occasionally you’ll need to point to a secure resource, which means you’ll need to pull in a secret key at runtime in order to access the “real” data. This could be a NuGet key, a SQL connection string, or a username and password—it doesn’t matter. The question is, how can you provide that secret value safely to the type provider? You certainly don’t want to hardcode your secret connection string into the application, so what can you do?