I'm playing around with Type Providers, specifically the sql entity framework type provider. I'm writing tests against a database that has a LOT of objects, and it's remote so the connection is a little slow. every time i build the project it takes a lot of time, good several minutes for the build to complete.
what am I missing why does the compiler doesn't cache the type information?
P.S. It's even worse with F# interactive....
Try using the LocalSchemaFile attribute for the data provider. This points to a .csdl file that is used to generate the types. You can have the type provider update this file by setting the ForceUpdate attribute to true. To run from a cached schema simply set ForceUpdate to false. Here is how I do this with the SqlDataConnection provider, which is very similar to the SqlEntityConnection provider.
type schema = SqlDataConnection< LocalSchemaFile = "Schema.dbml", ForceUpdate = false, ConnectionString = @"Data Source=<insert your connection string here>" >
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With