title: Accessing SQLEntityConnection F# type provider types
body: <p>When using the SQLEntityConnection F# type provider, the generated types provided by this type provider may not be used by other F# assemblies and, by implication, any other assemblies, such as a separate ASP.Net application, console application, C# program, etc. So the type provider must be marked internal or private. </p>
  
  <p>Moreover, functions that use the type provider may not be more accessible than the types provided by the type provider. So such functions must also be marked internal or private.</p>
  
  <p>What is the proper way to map these types, which by necessity must be marked internal or private, to something public which can be used outside the same assembly?</p>
  
  <p>A simple pattern using Entity Framework is to retrieve an entity from a DbContext, update some properties, call some methods, update some child entities, etc., then call SaveChanges() on the DbContext. Since the retrieved entity is still attached to the DbContext and the DbContext is still in scope, the changes are tracked automatically and the update is simple.</p>
  
  <p>Is the same workflow possible using the SQLEntityConnection F# type provider? My guess is no if the entity needs to be updated outside the assembly where the TypeProvider is used, e.g. in a C# MVC project, given the limitations I mentioned in the original post. What is a comparable approach to doing basic CRUD operations using the SQLEntityConnection type provider? Unfortunately, the official documentation is very lacking in basic operations. Maybe an alternate type provider is a better, more functional choice.</p>