Problem
It would be nice to be able to create Table instance without open connection to Cassandra for the purpose of development and testing. At the moment it is not possble since Table.Create method calls initialization of Metadata and opens ControlConnection. And there is no way to mock ControlConnection since it's internal.
The reason why ControlConnection is used in Table is that it provides Serializer for CqlGenerator.
Suggestion
Move Serializer property from ControlConnection to Configuration.
It appears to me that instead of
there could be something like
Use-case
We develop SaaS EDI system. It's resource demanding software.
Warm-up of the whole application on developers computer can take up to 1.5 minute. In order to decrease warm-up time and have better development experience we have created in-memory implementations of storages and caches. In many cases each in-memory implementation substitutes driver calls to a real storage and saves data into RAM.
Such approach
drastically reduces warm up time of the software;
allows to use the very same business code for tests, development, and production. The only difference is configuration of dependency injection container.
But, this approach of in-memory implementation became impossible because a single instance of Serializer per Cluster via ControlConnection was introduced in version 3.0.4.
Sample code of a suggested solution can be seen here:
https://github.com/datastax/csharp-driver/pull/424