|
|
|
|
@ -3,6 +3,7 @@ |
|
|
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using GBase.Exceptions; |
|
|
|
|
using GBase.FileHandling.Factories; |
|
|
|
|
using GBase.Interfaces; |
|
|
|
|
using GBase.Interfaces.DataHandling.Pool; |
|
|
|
|
@ -38,6 +39,9 @@ namespace GBase.Factories |
|
|
|
|
/// <returns>A newly created instance of the implementation for <see cref="IGBaseTable"/></returns> |
|
|
|
|
public IGBaseTable Create(Type type) |
|
|
|
|
{ |
|
|
|
|
if (!typeof(IGBaseObject).IsAssignableFrom(type)) |
|
|
|
|
throw new InvalidTableTypeException(type); |
|
|
|
|
|
|
|
|
|
Type gBaseTableType = typeof(GBaseTable<>).MakeGenericType(type); |
|
|
|
|
return (IGBaseTable) Activator.CreateInstance(gBaseTableType, _fileHandlerFactory, _dataHandlerPool, _gBaseColumnFactory); |
|
|
|
|
} |
|
|
|
|
|