Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Gemstone.Timeseries/Adapters/AdapterCollectionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,12 @@ public virtual bool TryCreateAdapter(DataRow adapterRow, out T adapter)
throw new InvalidOperationException("Specified adapter assembly does not exist");

Assembly assembly = Assembly.LoadFrom(assemblyName);
adapter = (T)Activator.CreateInstance(assembly.GetType(typeName)!)!;
Type? adapterType = assembly.GetType(typeName);

if (!typeof(T).IsAssignableFrom(adapterType))
throw new InvalidOperationException("Adapter type is not compatible with the adapter collection");

adapter = (T)Activator.CreateInstance(adapterType)!;

// Assign critical adapter properties
adapter.Name = name;
Expand Down