We create a generic module (BaseModule
The problem is Nancy are throw exception when trying create instance of BaseModule because it is generic type
How we can avoid this ?
@ndphuong I havn't checked this but you can try overriding the module registration to specify what modules you actually want registered:
protected override IEnumerable<ModuleRegistration> Modules
{
get
{
return base.Modules.Where(m => m.ModuleType == typeof(GenericBase<YourType>));
}
}
Make your generic module abstract
Great tip @thecodejunkie
Most helpful comment
Make your generic module
abstract